Skip to content

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

@elldritch

Description

@elldritch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions