-
-
Notifications
You must be signed in to change notification settings - Fork 389
Compliled-in fourmolu 1.4.0.0 in HLS 2.4.0.0 formats differently than standalone compiled fourmolu 1.4.0.0 #3882
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
Comments
I tried compiling fourmolu 1.4.0.0 using GHC 9.6.2 and it still put the
So I guess the version of |
I'm able to work around the problem by having HLS shell out to an external |
Thanks, but I don't think this is quite a duplicate of any of those. Maybe #3788, but the conversation in that issue is leading toward the idea that it's a fixity issue, and there's no fixity involved here, as there's only one operator. The issues #3454 and #3421 are solely about fixity, and fixity is not the issue here. As for #411, that seems to have been the motivation for allowing use of an external formatter, which does work for me. But that doesn't resolve the issue of why the built-in fourmolu is not formatting the same way as one compiled on its own, even if it's supposedly the same version as the built-in one. I suspect that the fixity discussion is a red herring and perhaps this ticket provides additional evidence toward that idea. What those tickets do show, though, is that this issue has been around for a long time. |
Hmm, that's weird: seems as though other operators, even Is |
Through experimentation, I found that Both the compiled-in fourmolu in HLS and the standalone fourmolu are reading the config file So that would be the thing to look for - what is the discrepancy that would make one build default the fixity for |
This is may be happening in the |
Your environment
Which OS do you use?
Windows
Which version of GHC do you use and how did you install it?
9.6.3 from nix
How is your project built (alternative: link to the project)?
cabal
Which LSP client (editor/plugin) do you use?
VSCode + Haskell extension
Which version of HLS do you use and how did you install it?
2.4.0.0 from nix
Have you configured HLS in any way (especially: a
hie.yaml
file)?No
Steps to reproduce
Create code that has an infix operator leading on a line, e.g.:
Format it via VSCode (Shift+Alt+F): It remains the same.
Format it on the command line using
fourmolu path/to/Main.hs
. It comes out with the$
on the end of the previous line:Expected behaviour
HLS in VSCode should format it with the
$
trailing afterM.fromList
.Actual behaviour
HLS in VSCode formats it with the
$
leading beforezipWith
.Debug information
On the command line:
In the HLS log within VSCode:
Note that it doesn't say what version of
ghc-lib-parser
it's using. Maybe that makes the difference? Was it compiled withghc-lib-parser 9.6.2
?The text was updated successfully, but these errors were encountered: