VSCode no intellisense in haskell extension for additional modules

Viewed 1870

Is there a way to make intellisense work for additional modules (anything outside the prelude) like Quicktest or Random in VS Code? I am using:

  • VSCode: Version 1.55.0
  • the extension "Haskell v1.2.0" (with haskel-language-server)
  • ghci: GHCi, version 8.10.3: https://www.haskell.org/ghc/
  • stack: Version 2.5.1, Git revision d6ab861544918185236cf826cb2028abb266d6d5 x86_64 hpack-0.33.0
  • tried it direct on Windows10 and with WSL2 (Debian).

VSCode says:

Could not find module ‘Test.QuickCheck’
It is not a module in the current program, or in any known package.not found

enter image description here So, no autocomplete etc..

I think the reason is that I've installed Quicktest via stack, and that stack uses its own "isolated" ghc. So I looked for a way to configure the VSCode extension to use the ghc of my stack environment, without success.

I've also tingled with haddock and cabal, without success.

Does anybody using VS-Code to code haskell and have autocomplete, documentation on mouse over, wingman, ...?

1 Answers

I was having this problem with some local modules. I was able to fix it by placing a hie.yaml file in the project's root directory and reloading VSCode. Admittedly I don't really know what it does. I generated it using implicit-hie which you can install with stack.

Related