haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.61k stars 352 forks source link

Calling Fourmolu via HLS infers wrong fixities #3421

Open RobinStoll opened 1 year ago

RobinStoll commented 1 year ago

When using Fourmolu as a formatter via HLS, it infers different fixities of binary operators than when calling Fourmolu directly via the command line. This happens regardless of whether HLS uses its built-in Fourmolu or calls an external one.

It happened with the following operators:

It is relatively easy to circumvent by specifying these fixities explicitly in fourmolu.yaml, but it is still a little annoying. It also took me a while to figure out why it was behaving differently.

Your environment

Which OS do you use? openSUSE Which LSP client (editor/plugin) do you use? VS Code & Haskell extension Which version of HLS do you use and how did you install it? 1.8.0.0 via ghcup via VS Code Haskell extension Have you configured HLS in any way (especially: a hie.yaml file)? Only via VS Code

georgefst commented 1 year ago

See #3454.

Getting these working for non-CLI mode may require some upstream refactoring to expose the right functionality, similarly to https://github.com/haskell/haskell-language-server/pull/3449.