Skip to content

Problem with multilibraries hierarchy: "It may not be listed in your .cabal file!" #4010

@teto

Description

@teto

Your environment

I've forked selda (an abstraction layer around postgres/sqlite) to add a feature, and tried adding HLS support.
If I git clone https://github.com/teto/selda.git -b array, then run nix develop , haskell-language-server is lost for some reason.

selda on  array via λ lts-18.28 via ❄️  IMPURE (ghc96-haskell-env-env) 
❌130 ❯ haskell-language-server selda/src/Database/Selda/SqlType.hs
2024-01-23T14:57:52.600979Z | Info | haskell-language-server version: 2.5.0.0 (GHC: 9.6.3) (PATH: /nix/store/28rqr38lzb9yf4zxl3xcjm7yvid8i03x-haskell-language-server-2.5.0.0/bin/.haskell-language-server-9.6.3-unwrapped)
2024-01-23T14:57:52.601649Z | Info | Directory: /home/teto/selda
2024-01-23T14:57:52.601799Z | Info | Logging heap statistics every 60.00s
 ghcide setup tester in /home/teto/selda.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/4: Finding files to test in /home/teto/selda
Found 1 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle
  ()

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
2024-01-23T14:57:52.605744Z | Info | Cradle path: selda/src/Database/Selda/SqlType.hs
2024-01-23T14:57:52.605824Z | Warning | No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for selda/src/Database/Selda/SqlType.hs.
Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2024-01-23T14:57:52.607460Z | Info | invoking build tool to determine build flags (this may take some time depending on the cache)
2024-01-23T14:57:52.607846Z | Info | updateFileDiagnostics published different from new diagnostics - file diagnostics: File:     /home/teto/selda/selda/src/Database/Selda/SqlType.hs
Hidden:   no
Range:    1:1-2:1
Source:   cradle
Severity: DiagnosticSeverity_Error
Message: 
  Loading the module '/home/teto/selda/selda/src/Database/Selda/SqlType.hs' failed.

  It may not be listed in your .cabal file!
  Perhaps you need to add `SqlType` to other-modules or exposed-modules.

  For more information, visit:
  https://cabal.readthedocs.io/en/3.4/developing-packages.html#modules-included-in-the-package

  "./ChangeLog.hs" - Cabal {component = Just "selda-build-tools:exe:selda-changelog"}
Files that failed:
 * /home/teto/selda/selda/src/Database/Selda/SqlType.hs

Completed (0 files worked, 1 file failed)

Perhaps you need to add SqlType to other-modules or exposed-modules.

The module exists in exposed-modules though ?

Which OS do you use? nixos

Which version of GHC do you use and how did you install it? 9.6.3 from nixpkgs

How is your project built (alternative: link to the project)? cabal

Which LSP client (editor/plugin) do you use? neovim+haskell-tools.nvim

Which version of HLS do you use and how did you install it?

$ haskell-language-server --version
haskell-language-server version: 2.5.0.0 (GHC: 9.6.3) (PATH: /nix/store/28rqr38lzb9yf4zxl3xcjm7yvid8i03x-haskell-language-server-2.5.0.0/bin/.haskell-language-server-9.6.3-unwrapped)

Have you configured HLS in any way (especially: a hie.yaml file)?
Nope, the implicit cradle have been working fine for some time now

Debug information

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions