HLS fails to compile where "stack repl" succeeds, even with hie.yaml: cradle: stack: #4484
Labels
status: needs triage
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Summary/TLDR
I am trying to get a minimal example of LiquidHaskell working with HLS, and I'm running into the following issue:
The
haskell-language-server-wrapper
command produces an inappropriate compilation error:The
stack repl
command, on the other hand, compiles successfully without producing the error (this is the correct behavior, as the code itself is correct).HLS produces the error despite the project containing a
hie.yaml
file with these contents:My understanding was that this was supposed to make HLS build "the same way" that Stack does. Why might HLS build differently than Stack, even when the hie.yaml file is present?
Your environment
Which OS do you use?
Arch Linux
Which version of GHC do you use and how did you install it?
GHC 9.8.1 from ghcup
How is your project built (alternative: link to the project)?
I am building this project: https://github.com/ucsd-progsys/lh-plugin-demo.git via Stack. Please see "Steps to reproduce" for more details.
Which LSP client (editor/plugin) do you use?
VSCode + vscode-haskell
Which version of HLS do you use and how did you install it?
HLS 2.6.0.0 from ghcup
Have you configured HLS in any way (especially: a
hie.yaml
file)?hie.yaml
file with the following contents:Steps to reproduce
Install the following via ghcup:
Then:
git clone https://github.com/ucsd-progsys/lh-plugin-demo.git
Replace the contents of the
stack.yaml
file with the following:Create a top-level
hie.yaml
file with the following contents:Replace the contents of
src/Demo/Client.hs
with the following:At this point,
stack build
compiles with no errors.stack ghci
compiles with no errors.stack repl
compiles with no errors.haskell-language-server-wrapper
produces a compilation error:Why might HLS build differently than Stack, even when the hie.yaml file is present? Thank you in advance for your help!
Expected behaviour
The
haskell-language-server-wrapper
command should compile successfully, without producing compilation errors, just like thestack build
command already does.Actual behaviour
haskell-language-server-wrapper
produces a compilation error:This compilation error is incorrect because the refinement type
Pos
should be successfully imported from the module Demo.Lib in which it is defined.Debug information
I was able to recreate this issue with ghcid.
The command
ghcid
fails to compile with the same error that HLS is producing.The command
ghcid "--command=stack ghci"
compiles with no errors, giving theAll good
message. This does not immediately help me resolve the issue with HLS, though.Output of
haskell-language-server-wrapper --debug
:The text was updated successfully, but these errors were encountered: