Closed marcosh closed 1 year ago
Hi, thank you for your bug report!
Can you include the logs of the invocation haskell-language-server-wrapper --debug src/Foo.hs
here?
At a first glance, I can't quite believe that HLS has a problem with unpublished dependency versions, since we have no idea about Hackage.
I presume, stack repl
succeeds?
The logs of the haskell-language-server-wrapper --debug src/Foo.hs
invocation are
I confirm that stack repl
works fine.
If you want, you can reproduce the issue with the repository I linked in the issue (https://github.com/marcosh/wrong-dependency-version-test)
The logs you linked do not demonstrate an error. Locally, I can reproduce, but stack build
itself fails for me.
I think, you probably have to make sure in your project stack build
and stack repl
succeeds. If it does, HLS works.
As it looks like, this is a stack bug.
Linking this issue to https://github.com/commercialhaskell/stack/issues/6154, to make this kind of issue seen in the new mega ticket.
@fendor as I mentioned in the issue, the error appears only when I use HLS through vscode.
I guess stack build
is failing on your machine because the dependency requires having node 16
installed (this is quite unfortunate...). I assure you that stack build
and stack repl
are working correctly on my end.
I got it to compile with the nix expression NIXPKGS_ALLOW_INSECURE=1 nix-shell -p nodejs-16_x gmp zlib
After that, it just worked.
Proof:
Stack version:
> stack --version
Version 2.9.3, Git revision 6cf638947a863f49857f9cfbf72a38a48b183e7e x86_64 hpack-0.35.1
The only other thing I can imagine are poisoned caches. Make sure to delete the cache in ~/.cache/ghcide
and maybe even ~/.cache/hie-bios
.
@fendor probably it was really a cache issue. I cleared ~/.cache/ghide
, ~/.cache/hie-bios
and also ~/.stack
and now everything is working properly.
Thanks a lot for your help
My project depends on a fork of a library which has a version number which is not published on Hackage. While this is not a problem for Stack, it appears to be a problem for HLS when used inside VScode
Your environment
Which OS do you use? Manjaro Linux
Which version of GHC do you use and how did you install it? GHC 9.2.7 installed with ghcup
How is your project built (alternative: link to the project)? https://github.com/marcosh/wrong-dependency-version-test
Which LSP client (editor/plugin) do you use? VSCode
Which version of HLS do you use and how did you install it? 2.0.0 from ghcup
Have you configured HLS in any way (especially: a
hie.yaml
file)? I have the followinghie.yaml
What's wrong?
Building the project with
stack build
works fine. Inspecting the project withhaskell-language-server-wrapper
works fine. Opening thesrc/Foo.hs
file with Visual Studio Code produces the following error:Debug information
The
Output
section of VSCode produces the following output