-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Fourmolu plugin formats code differently compared to separate installation of fourmolu #3788
Comments
Sounds like we're somehow using different configuration to what the CLI fourmolu is getting? |
Yes, I theorised the fixity of |
That sounds likely. It's unfortunate that using the extra information we have in HLS can let us do better formatting, but make #411 worse. |
That makes sense. I'm also curious why HLS formats it the way that it does? To me the one formatting that separate fourmolu produces looks nicer and more similar to how what's commonly used in Haskell ecosystem in general. |
I guess that's a question for the fourmolu devs. If our guess is correct, that's just what fourmolu does if it knows the fixity of |
Yes, that's simply the behavior when Fourmolu doesn't know the fixity of an operator. Some follow up questions:
|
|
hm I don't use HLS, so I'm not sure how much help I'd be here. @ollimandoliini it seems like you have a pretty basic set up. Does it work if you're in a completely separate directory (e.g. @georgefst do you have any idea? |
Not yet, but I'll try to look in to this as soon as I can. I do have a pretty big backlog of Fourmolu stuff that I want to at least comment on, but this might be the highest priority. It's just hit me and it's super annoying. Although for now, I seem to be getting away with switching back to non-CLI mode (EDIT: ah, I misread that OP is already using this mode - I may just be running in to #3421). Though this won't necessarily work for people who aren't wanting to use 0.14. |
I can confirm that I also stumbled upon this issue of the HLS Fourmolu plugin formatting very differently than just the executable. |
Fortunately it's the opposite, which is easier to fix! I do also intend, in a separate PR, to modify the external Fourmolu mode to (at least have the option to) avoid passing |
Your environment
Which OS do you use?
MacOS
Which version of GHC do you use and how did you install it?
9.6.2 from GHCUp
How is your project built (alternative: link to the project)?
Which LSP client (editor/plugin) do you use?
VSCode and vscode-haskell
Which version of HLS do you use and how did you install it?
2.2.0.0 from GHCUp
Have you configured HLS in any way (especially: a
hie.yaml
file)?Whether you have
fourmolu.yaml
or not doesn't change the behaviour.Steps to reproduce
Have the HLS configured to use the built-in installation of fourmolu and run the formatting command.
Expected behaviour
The could should be formatted with the following output like a separate installation of
fourmolu-0.13.1.0
does.Actual behaviour
Running VSCode's formatting command while having HLS use the built-in fourmolu will format the code to the following form:
Debug information
vscode-haskell outputs the following log entry:
The text was updated successfully, but these errors were encountered: