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

Format cabal files #241

Closed
WillSewell opened this issue Jun 28, 2020 · 7 comments
Closed

Format cabal files #241

WillSewell opened this issue Jun 28, 2020 · 7 comments
Labels
help wanted type: enhancement An enhancement to an already existing feature

Comments

@WillSewell
Copy link

It would be nice if this extension could format cabal files with cabal format.

Is there a reason (technical or otherwise) why this might not be a good idea?

If you agree that it would be nice to have, it's something I'd be happy to have a go at implementing.

@fendor
Copy link
Collaborator

fendor commented Jun 28, 2020

It could be a plugin in Haskell Language Server, e.g. cabal-fmt
I think cabal format itself doesnt do a lot. Also, maybe developers have only stack installed, so it might even not be available.

In my opinion, it would be a very nice addition!

@jneira jneira added type: enhancement An enhancement to an already existing feature help wanted labels Jun 28, 2020
@WillSewell
Copy link
Author

Ah I had assumed that vscode-hie-server called Haskell formatters (brittany, ormolu) directly. Does it invoke the via Haskell Language Server? Either way I think this should be consistent.

@jneira
Copy link
Member

jneira commented Jun 29, 2020

@WillSewell yeah, the formatting should be added in hls as a plugin. I've added a issue to track it in the hls repo: haskell/haskell-language-server#183

@lukel97
Copy link
Collaborator

lukel97 commented Jul 29, 2020

Closing since this has been moved to haskell-language-server!

@lukel97 lukel97 closed this as completed Jul 29, 2020
@berberman
Copy link
Collaborator

cabal-fmt does not seem to export its API to be called on the server side, so I wrote a very simple vscode extension to call it on the command line: https://github.com/berberman/vscode-cabal-fmt

@jneira
Copy link
Member

jneira commented Feb 10, 2021

some time ago I had the crazy idea of setup a LSP server for cabal with diagnostics, completions, create non existing modules and trigger cabal commands.
crazy indeed

@ndmitchell
Copy link

I think a Cabal LSP is an inevitability - in the fullness of time - it's just a reasonable amount of work for something that is a much smaller amount of benefit (people don't spend that much time editing .cabal files)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted type: enhancement An enhancement to an already existing feature
Projects
None yet
Development

No branches or pull requests

6 participants