emacs-lsp / lsp-haskell

lsp-mode :heart: haskell
https://emacs-lsp.github.io/lsp-haskell
GNU General Public License v3.0
227 stars 56 forks source link

HLint code-action fails #98

Closed jul1u5 closed 3 years ago

jul1u5 commented 3 years ago

Hi,

I am using Doom Emacs 27.1 on NixOS and I am unable to apply any HLint suggestions. I get this error:

LSP :: Please open an issue in lsp-mode for implementing `21782:hlint:applyOne'.

(error "ExitFailure 1")

As per the error message, I was not sure if I should file an issue here or in lsp-mode. Since I was using Haskell LSP, I thought that filing an issue here would be more appropriate. Let me know if that's not the case.

I also noticed that this message appears in *lsp-haskell::stderr* buffer:

Missing file: /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ghc-8.10.2/lib/ghc-8.10.2/settings

It seems that the Nix hash for GHC was supposed to be substituted here but failed for some reason. GHC is actually in /nix/store/4gz77sky04mdw54lcg7h9xpjnsd8873h-ghc-8.10.2 and /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-ghc-8.10.2 doesn't exist.

I tried to apply HLint suggestion on VS Code and it worked there. So, I think that the issue is with lsp-haskell or lsp-mode.

jul1u5 commented 3 years ago

I actually get the same issue with VS Code. I mistakenly applied a non-hlint suggestion which worked and thought that Emacs was at fault. However, applying anything of the form Apply hint: ... also fails on VS Code.

So, the issue is probably with haskell-language-server itself or with Nix.

EDIT: this seems to be the root cause https://github.com/haskell/haskell-language-server/issues/591 and https://github.com/alanz/ghc-exactprint/issues/96