Closed
Description
Not sure if this is specifically the plugins issue or just a problem with cabal.
I have the following super simple directory structure:
-src
--Main.hs
--Lib.hs
--Test.hs
and module in my cabal file look like this:
library mylib
exposed-modules: Lib
build-depends: base ^>=4.14.3.0
hs-source-dirs: src
default-language: Haskell2010
executable myexe
main-is: Main.hs
build-depends:
base ^>=4.14.3.0,
mylib
hs-source-dirs: src
default-language: Haskell2010
test-suite mytest
type: exitcode-stdio-1.0
main-is: Test.hs
build-depends:
base ^>=4.14.3.0,
mylib,
hspec,
tasty,
tasty-hspec
hs-source-dirs: src
default-language: Haskell2010
When having the following imports in the Test.hs file:
import Test.Hspec
import Test.Tasty
import Test.Tasty.Hspec
The VSCode plugin shows me on these lines the following error:
Could not load module ‘Test.Tasty.Hspec’
It is a member of the hidden package ‘tasty-hspec-1.2’.
Perhaps you need to add ‘tasty-hspec’ to the build-depends in your .cabal file.
When I move the Test file into a separate directory or subdirectory, the problem goes away, but I would like not to create subdirectories for such super simple use cases.
I would however expect that the error would not show since the file is only in the mytest
module.