vscode-ghc-mod icon indicating copy to clipboard operation
vscode-ghc-mod copied to clipboard

ghc-mod cannot load modules when root of opened folder is above root of project

Open elldritch opened this issue 7 years ago • 0 comments

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.

elldritch avatar Jan 19 '18 08:01 elldritch