ghcmod cannot find module(s) #644
Description
First of all, thanks a lot for HIE that is now my Haskell engine in VSC.
Here is an issue I observe when I have project with a main source directory + a test one.
Summary
I have a project built with several targets (library, executable, test-suite).
The "main" sources are in src
, while the tests are in test
.
All is ok with the source files but on test files modules are not found.
How to reproduce
git clone https://github.com/pascalpoizat/veca-haskell
cd veca-haskell
gco multiple-component-instances
open . -a Visual\ Studio\ Code
Then in VSC open any file in the test directory (eg EventsTests.hs
).
There is an error on the two Tasty imports.
[ghcmod]
Could not find module ‘Test.Tasty’
Use -v to see a list of the files searched for.
Possible solution
This could be close to an issue I had when using Haskero,
https://gitlab.com/vannnns/haskero/issues/30,
the solution being a button to select the target (or "all targets"),
https://gitlab.com/vannnns/haskero/merge_requests/1.
Environment
~/hie
hie hie-8.2 hie-8.2.1 hie-8.2.2 hie-8.4 hie-8.4.2 hie-8.4.3 hie-wrapper
❯ hie --version
Version 0.2.0.0, Git revision 374da0753b4c126eb71175284f0b6e551674abb6 (1515 commits) x86_64 ghc-8.4.3
Stack file: https://github.com/pascalpoizat/veca-haskell/blob/multiple-component-instances/stack.yaml
Cabal file: https://github.com/pascalpoizat/veca-haskell/blob/multiple-component-instances/veca-haskell.cabal