Open
Description
Your environment
Which OS do you use?
Ubuntu
Which version of GHC do you use and how did you install it?
9.4.4 / ghcup. Note that issue repros with other supported versions
How is your project built (alternative: link to the project)?
stack defaults. See repro instructions on new stack project below
Which LSP client (editor/plugin) do you use?
neovim + coc.nvim. Repros in VSCode as well
Which version of HLS do you use and how did you install it?
1.9.0.0. As above, other versions repro
Have you configured HLS in any way (especially: a hie.yaml
file)? No, but see note below
Steps to reproduce
stack new --resolver nightly-2023-01-28 test
- Ensure
ghc-9.4.4
andHLS-1.9.0.0
are installed - Navigate to
./test
- Open
app/Main.hs
. Note that an error is issued:cannot satisfy -package test-0.1.0.0
. If other dependencies are specified inpackage.yaml
, it may complain of being unable to satisfy one of those instead.
Some observations that are hopefully clues:
- If
app/Main.hs
is opened first and thensrc/Lib.hs
, the same error is displayed at the top of both files. In reverse order,HLS
works fine on any files insrc
but still fails on files inapp
. - I've stumbled across several ways to fix the problem. I suspect they're all achieving the same effective result. Make sure to close your editor and run
stack purge
before trying them:- Run
stack build
. Openapp/Main.hs
up in an editor. It works! (Sidenote: I do this /stack run
regularly during development, so I've been seeing this problem disappear "magically" for a while. It was only upon starting a new project today and deciding to dig in and file a bug that I made the connection.) - Run
haskell-language-server-wrapper
. This will fail onSetup.hs
for a default stack project, but we can just ignore that. This seems like a clue thathaskell-language-server-wrapper
is doing something different build-wise when run with--lsp
vs. without. - Make a simple
hie.yaml
, i.e.cradle:\n stack:
. Same result. This could be a clue that implicit-hie is being used strangely (or itself has a bug).
- Run
Expected behaviour
Everything works without taking any of the steps detailed above.
Actual behaviour
(Covered in Steps to reproduce)
Debug information
N/A