fourmolu
fourmolu copied to clipboard
Allow specifying Ormolu CLI flags in config file
It would be lovely to be able to specify extensions (-XBlockArguments, etc) in the config. This would be a strong selling point vs Ormolu.
it'd be super cool if we could parse the package.ymal or cabal file on startup to pick out default-extensions too
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...
Hey I added this feature (automatically reading default extensions from the .cabal file) to hindent, and you could totally just copy the code.
Well, it's been added upstream, even though I'm sure I remember them originally rejecting the idea: https://github.com/tweag/ormolu/pull/759.
~~So we just need to merge (see https://github.com/fourmolu/fourmolu/pull/106, though there have been more changes in Ormolu since then).~~ Done: #106
Any update on this? I cannot find a way to specify --cabal-default-extensions
when using HLS
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
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 https://github.com/haskell/haskell-language-server/pull/2763. Which will be in the next HLS release.
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.