Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with purty #5

Open
joneshf opened this issue Jun 21, 2019 · 3 comments
Open

Integration with purty #5

joneshf opened this issue Jun 21, 2019 · 3 comments

Comments

@joneshf
Copy link

joneshf commented Jun 21, 2019

Howdy!

I maintain a source code formatter: purty. I'd like to add support for using it from emacs.

Is this something that could be added to purescript-mode? If so, I'd like the burden on you to be as minimal as possible, so when the API of purty changes, I expect to update whatever's necessary to work here. Would it be easier if I maintained a purty-mode and purescript-mode depended on it somehow (I don't know enough about the emacs ecosystem). If it shouldn't be added to purescript-mode, no worries.

@t61j
Copy link

t61j commented Jun 8, 2020

Hi, any news on this? It would be really nice if purty integrated with purescript-mode already, even if it wouldn't have all the features wanted yet.
One of the worst things to me as beginner when writing purescript occurs when I need to edit jsx style nodes (react-basic for example). When I need to wrap some long snippet with another div, moving everything correctly again by hand is very tedious). purty in those cases makes such a difference.
At the moment I use:

(use-package purescript-mode
  :ensure t
  :config
  (defun format-ps ()
    (interactive)
    (set-process-sentinel
     (start-process "auto-format-purescript"
                    (current-buffer)
                    "purty"
                    "--write"
                    buffer-file-name)
     (lambda (process event)
       (revert-buffer :ignore-auto :noconfirm))))
  :bind ("C-c C-f" . format-ps)
  :mode ("\\.purs$" . purescript-mode))

@kritzcreek
Copy link
Contributor

Can you just use https://github.com/lassik/emacs-format-all-the-code? According to the README it knows how to invoke purty on PureScript code.

@t61j
Copy link

t61j commented Jun 8, 2020

Can you just use https://github.com/lassik/emacs-format-all-the-code? According to the README it knows how to invoke purty on PureScript code.

😅 Oh nice, I didn't know this package. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants