Skip to content

HLS can't find extra-deps defined in stack.yaml #4743

@EnriqueVidal

Description

@EnriqueVidal

Your environment

Which OS do you use?
Linux

Which version of GHC do you use and how did you install it?
9.8.4 from ghcup 0.1.50.2

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

Which LSP client (editor/plugin) do you use?
NeoVim 0.11 with lsp-config

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

Have you configured HLS in any way (especially: a hie.yaml file)?

I have added an hie.yaml that only includes:

cradle:
  stack:

What's wrong?

I am trying to update my xmonad config using neovim and hls, my stack.yaml has two packages xmonad and xmonad-contrib and one extra-dep split-0.2.5 running stack build works fine, however jumping into neovim, the lsp gives me the error:

not found: Could not load module 'Data.List.Split'. It is a member of the hidden package 'split-0.2.5'

I've been trying to make this work for a bit and found that setting ghc-options in stack.yaml like this:

ghc-options:
  "$locals": -package split

Fixes the issue for hls but breaks the stack build.

I have tried using gen-hie and also setting components manually but have not been able to get around this, I am positive I must be doing something wrong but I'm not sure what that is.

stack repl and stack ghci both work, but in order to use Data.List.Split I also need to :set -package split

Debug information

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions