-
-
Notifications
You must be signed in to change notification settings - Fork 414
Description
Your environment
Which OS do you use?
NixOS 22.11
Which version of GHC do you use and how did you install it?
9.0.2 installed using nix
Which LSP client (editor/plugin) do you use?
VS Codium+vscode-haskell
Which version of HLS do you use and how did you install it?
1.8.0.0 installed using nix
Have you configured HLS in any way (especially: a hie.yaml file)?
No
What's wrong?
I was trying to use haskell to write some small scripts, by adding a shebang at the top of the file and de dependencies as a comment at the top of the file, like this:
#! /usr/bin/env nix-shell
#! nix-shell -i cabal -p ghc cabal-install
{- cabal:
build-depends:
, base ^>= 4.15
, elm-syntax
-}
import Language.Elm.Expression as Elm
main :: IO ()
main = do
putStrLn "Hello"If I then make the file executable (chmod +x ...) it runs as expected (showing Hello).
However, in my editor (VS Code) I get the error Could not find module ‘Language.Elm.Expression’.
Is there a way to tell the Haskell Language Server to read those build-depends in the comment at the top of the file?
I'm not sure what to call that comment, so Googling didn't help, but probably just because I don't know what to call it.