vscode-ghc-mod
vscode-ghc-mod copied to clipboard
ghc-mod cannot load modules when root of opened folder is above root of project
I work in a monorepo, so I often have vscode opened to a folder containing my Haskell project. My project layout looks something like this:
monorepo/ <- vscode is opened here
project1/
project2/
haskell-project/ <- target Haskell project is here
stack.yaml
project.cabal
When I try to view a type with vscode opened at monorepo/
, ghc-mod will often return something like Could not find module 'X' Use -v to see a list of the files searched for.
. When I open vscode at haskell-project
, the type-on-hover works again.
Ideally, the extension would detect the root of Haskell projects (probably by the existence of a *.cabal
file) and run ghc-mod in that directory.