Kraego
Kraego

Reputation: 3882

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

Upvotes: 9

Views: 3298

Answers (2)

Kraego
Kraego

Reputation: 3882

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

Upvotes: 0

chasminimus
chasminimus

Reputation: 21

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.

Upvotes: 2

Related Questions