haskellvisual-studio-codehaskell-stack

VSCode no intellisense in haskell extension for additional modules


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 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, ...?


Solution

  • Since I'm now revisiting haskell: The current VSCode Version 1.83.1 with the haskell extension Haskell 2.4.2. Autocomplete etc. are working fine.

    Go to project folder init stack and install a package:

    init stack
    stack install split
    

    Restart VScode for an implicit GHC restart. Afterwards everything works as expected see below:

    VSCode showing package doc