Description
Hello, I'm not sure if this is a configuration issue with my hie.yaml, but I'm unable to get HLS to work with two Main.hs files at the same time. There's no issues with compiling both of them with cabal though.
Your environment
Which OS do you use?
Windows WSL2 running CentOS Stream 9
Which version of GHC do you use and how did you install it?
GHC 9.4.4 from ghcup
How is your project built (alternative: link to the project)?
https://gitlab.com/vmatassa/hls-two-main-example
Which LSP client (editor/plugin) do you use?
vscode
Which version of HLS do you use and how did you install it?
HLS 1.9.1.0 from ghcup
Steps to reproduce
- Open projectA/app/Main.hs
- Open projectB/app/Main.hs right after
Actual behaviour
HLS is unable to recognize libraries that are exclusively in projectB cabal's file.
Could not load module ‘Data.Aeson’
It is a member of the hidden package ‘aeson-2.1.2.1’.
Perhaps you need to add ‘aeson’ to the build-depends in your .cabal file.
It is a member of the hidden package ‘aeson-2.1.1.0’.
Perhaps you need to add ‘aeson’ to the build-depends in your .cabal file.
It is a member of the hidden package ‘aeson-2.1.1.0’.
Perhaps you need to add ‘aeson’ to the build-depends in your .cabal file.
Expected behaviour
HLS should be able to find installed libraries from all cabal files in the project.