Getting could not find module despite successful build with packages. The module is QuickCheck


package.yaml :
executables:
wk4-exe:
main: wk4.hs
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- QuickCheck
stack.yaml :
resolver: lts-14.27
packages:
- .
extra-deps:
- QuickCheck-2.13.2
Can you output the contents of the Haskell tab from the Output window in VS Code?
Can you output the contents of the Haskell tab from the Output window in VS Code?
[client] run command: "C:\Users\Ratanak\AppData\Roaming\local\bin\haskell-language-server.exe --lsp -d -l C:\Users\Ratanak\AppData\Roaming\local\bin\logs2.txt"
[client] debug command: "C:\Users\Ratanak\AppData\Roaming\local\bin\haskell-language-server.exe --lsp -d -l C:\Users\Ratanak\AppData\Roaming\local\bin\logs2.txt"
[client] server cwd: undefined
haskell-language-server version: 0.2.2.0 (GHC: 8.6.5) (PATH: C:\Users\Ratanak\AppData\Roaming\local\bin\haskell-language-server.exe) (GIT hash: d74d1113d37125a69e25e8cf9f0a8244b3c0d673)
Starting (haskell-language-server)LSP server...
with arguments: LspArguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Just "C:\\Users\\Ratanak\\AppData\\Roaming\\local\\bin\\logs2.txt", argsThreads = 0, argsProjectGhcVersion = False}
with plugins: [PluginId "brittany",PluginId "eval",PluginId "floskell",PluginId "fourmolu",PluginId "ghcide",PluginId "ormolu",PluginId "pragmas",PluginId "retrie",PluginId "stylish-haskell"]
in directory: f:\Users\Ratanak\School\UNI\CS3141_2020
If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option!
Started LSP server in 0.05s
Output from setting up the cradle Cradle {cradleRootDir = "f:\\Users\\Ratanak\\School\\UNI\\CS3141_2020", cradleOptsProg = CradleAction: Default}
The project discovery has failed you!
Let's take a look at the cradle: (which tells hls where your root directory is and which tool (cabal/stack) it should use to load your project)
Cradle
{ cradleRootDir = "f:\\Users\\Ratanak\\School\\UNI\\CS3141_2020"
, cradleOptsProg = CradleAction: Default
}
Is the path "f:\\Users\\Ratanak\\School\\UNI\\CS3141_2020" the root of your project? Is your stack.yaml in the same directory?
The record cradleOptsProg should have the value CradleAction: Stack, that's how you know it configures your project correctly!
On windows, I usually use Open Folder and open exactly the folder that contains my project.
The project discovery has failed you!
Let's take a look at the cradle: (which tells hls where your root directory is and which tool (cabal/stack) it should use to load your project)Cradle { cradleRootDir = "f:\\Users\\Ratanak\\School\\UNI\\CS3141_2020" , cradleOptsProg = CradleAction: Default }Is the path
"f:\\Users\\Ratanak\\School\\UNI\\CS3141_2020"the root of your project? Is yourstack.yamlin the same directory?
The recordcradleOptsProgshould have the valueCradleAction: Stack, that's how you know it configures your project correctly!On windows, I usually use
Open Folderand open exactly the folder that contains my project.
No it is not. It is a few more folders in. I will try to replicate the open folder.
But I found a workaround by having a hie.yaml in the root of the project folder.
It seems this is not a bug. but hie-bios behaviour, so i am gonna close it. @ratanakkim please reopen if you think something could be improved
Most helpful comment
Can you output the contents of the Haskell tab from the Output window in VS Code?