on a brand new stack project
the extension (hls) fails with this error:
Couldn't figure out what GHC version the project is using: /home/dankey/.config/Code/User/globalStorage/haskell.haskell/haskell-language-server-wrapper-1.4.0-linux --project-ghc-version exited with exit code 1: Found "/home/dankey/dev/projects/bla/hie.yaml" for "/home/dankey/dev/projects/bla/a" Failed to get project GHC version:CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitFailure 1, cradleErrorStderr = ["Error when calling stack setup --silent","",""]}
this is the output from the haskell section on the output tab
[client][ERROR] Error executing '/home/dankey/.config/Code/User/globalStorage/haskell.haskell/haskell-language-server-wrapper-1.4.0-linux --project-ghc-version' with error code 1
[client][ERROR] stderr: Found "/home/dankey/dev/projects/bla/hie.yaml" for "/home/dankey/dev/projects/bla/a"
Failed to get project GHC version:CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitFailure 1, cradleErrorStderr = ["Error when calling stack setup --silent","",""]}
The error messages seem to mention a file /home/dankey/dev/projects/bla/a, does that exist as a file or directory? I don’t think it is part of the standard stack new template.
but note that $PATH should refer to directories, not executables. I’m guessing something might have become confused at seeing executables mentioned directly like that. (Just having /usr/bin in PATH would be sufficient to find both “cabal” and “ghc”, FWIW.)
For further future reference, the filepath a within your project is a dummy filepath. It is solely used for finding the cradle type (e.g. stack/cabal or direct or shell) and carries no meaning. It is always the first question of hls what the cradle type and ghc version is, but until you have opened a real file, it can’t really know. Thus, we supply a fake filepath that only used for establishing the project root.