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

Allow specifying Ormolu CLI flags in config file #58

Open
neongreen opened this issue Jan 20, 2021 · 8 comments
Open

Allow specifying Ormolu CLI flags in config file #58

neongreen opened this issue Jan 20, 2021 · 8 comments

Comments

@neongreen
Copy link
Contributor

It would be lovely to be able to specify extensions (-XBlockArguments, etc) in the config. This would be a strong selling point vs Ormolu.

@parsonsmatt
Copy link
Collaborator

it'd be super cool if we could parse the package.ymal or cabal file on startup to pick out default-extensions too

@georgefst
Copy link
Collaborator

It would be lovely to be able to specify extensions (-XBlockArguments, etc) in the config.

I've never cared too much about this, since I almost exclusively use Fourmolu via HLS. But I appreciate it would be useful, and it's particularly been on my radar since it was requested yesterday. There's a bit of a backlog of Fourmolu work that I expect to get back to in the next few weeks. In the meantime, a PR would be great if you're so inclined.

it'd be super cool if we could parse the package.ymal or cabal file on startup to pick out default-extensions too

I wonder if we could get this via something like hie-bios...

@georgefst georgefst changed the title Allow specifying GHC options in the config Allow specifying GHC options in the config (and/or picking up from stack/cabal) Jan 20, 2021
@AshleyYakeley
Copy link

Hey I added this feature (automatically reading default extensions from the .cabal file) to hindent, and you could totally just copy the code.

@georgefst
Copy link
Collaborator

georgefst commented Sep 26, 2021

Well, it's been added upstream, even though I'm sure I remember them originally rejecting the idea: tweag/ormolu#759.

So we just need to merge (see #106, though there have been more changes in Ormolu since then). Done: #106

@s0kil
Copy link

s0kil commented Apr 11, 2022

Any update on this? I cannot find a way to specify --cabal-default-extensions when using HLS

@brandonchinn178 brandonchinn178 changed the title Allow specifying GHC options in the config (and/or picking up from stack/cabal) Allow specifying Ormolu CLI flags in config file Apr 17, 2022
@brandonchinn178
Copy link
Collaborator

No update yet, but I made the title more reflective of the fact that we now support --cabal-default-extensions like Ormolu. Ideally, we should be able to support any Ormolu flag in the config file; hopefully it can also be done in a way to minimize merge conflicts with Ormolu in app/Main.hs

Probably intersects a great deal with #150

@georgefst
Copy link
Collaborator

Any update on this? I cannot find a way to specify --cabal-default-extensions when using HLS

You could write a wrapper around Fourmolu and call it using haskell/haskell-language-server#2763. Which will be in the next HLS release.

@georgefst
Copy link
Collaborator

georgefst commented Jun 7, 2022

You could write a wrapper around Fourmolu and call it using haskell/haskell-language-server#2763. Which will be in the next HLS release.

Although actually, it shouldn't be necessary if you've got HLS working correctly, unless you've got a pretty esoteric setup? The Fourmolu HLS plugin has always been passed GHC options from the environment, which includes those specified in a Cabal file.

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

6 participants