HLS seems to require a library stanza in the cabal file #3932
Labels
can-workaround
component: implicit-hie
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Environment
OS: NixOS
GHC Version: 9.4.8
Cabal Version: 3.10.2.1
HLS Version: 2.4.0.0
Everything is installed via a nix flake. Here is my project at the time of issue submission: https://github.com/Rotaerk/vulkanSandbox/tree/85d04fd4a834000cb47a7992207f8c74c5028428
What's wrong?
Within the repository root, I run
nix develop
, which brings cabal, ghc, and HLS among other things into my path. I navigate into the VulkanSandbox directory, and runhaskell-language-server-wrapper
. When I do, it discovers all 14 of my source files, but fails to load every one, indicating that I need to add them to other-modules or exposed-modules in the cabal file. But they are already there.The cabal file only has two stanzas: a common and an executable. I noticed that if I change the executable stanza into a library (and removed main-is), suddenly HLS is able to load the source files.
I also noticed that it works if I rename the executable stanza to VulkanSandboxExe, and then add a library stanza to it, such as:
Note: I tested and confirmed that renaming the executable stanza alone was not enough.
Did I miss something in the HLS documentation about requiring library stanzas?
The text was updated successfully, but these errors were encountered: