Closed
Description
Your environment
-
Which OS do you use? macOS Monterey 12.5.1
-
Which version of GHC do you use and how did you install it? GHC-9.4.2, installed via ghcup
-
How is your project built (alternative: link to the project)? Via Cabal-3.8.1.0
-
Which LSP client (editor/plugin) do you use? VS Codium+vscode-haskell
-
Which version of HLS do you use and how did you install it? 1.8.0.0 via ghcup
-
Which LSP client (editor/plugin) do you use? VS Code + Haskell v2.2.1
-
Have you configured HLS in any way (especially: a
hie.yaml
file)? Nohie.yaml
In the$HOME/Library/Application Support/Code/User/settings.json
:
"haskell.hlint.executablePath": "/Users/ur20980/.cabal/bin/hlint",
"haskell.hlint.logLevel": "info",
"haskell.hlint.ignore": ["camelCase"],
"haskell.trace.server": "messages",
"haskell.updateBehavior": "prompt",
"haskelly.exec.reuseTerminal": true,
"haskell.plugin.ghcide-type-lenses.config.mode": "always",
"haskell.plugin.alternateNumberFormat.globalOn": false,
"haskell.ghcupExecutablePath": "/Users/ur20980/.ghcup/bin/ghcup",
"[haskell]": {
"editor.defaultFormatter": "sjurmillidahl.ormolu-vscode"
},
"haskell.manageHLS": "GHCup",
"haskell.plugin.eval.config.exception": true,
"haskell.serverEnvironment": {
"PATH": "${HOME}/.ghcup/bin:${PATH}",
},
"haskell.serverExecutablePath": "${HOME}/.ghcup/bin/haskell-language-server-wrapper",
Steps to reproduce
Start VS Code and open project directory.
Expected behaviour
No errors.
Actual behaviour
VS Code error message popup:
Failed to find the GHC version of this Cabal project. Error when calling cabal exec -v0 -- ghc --print-libdir
Source: Haskell (Extension)
In the Terminal:
$ cabal exec -v0 -- ghc --print-libdir
/Users/ur20980/.ghcup/ghc/9.4.2/lib/ghc-9.4.2/lib
$
Debug information
Tried to check Troubleshooting page, did not get far with VS Code on Mac.
$ haskell-language-server-wrapper --probe-tools
haskell-language-server version: 1.8.0.0 (GHC: 9.4.2) (PATH: /Users/ur20980/.ghcup/hls/1.8.0.0/lib/haskell-language-server-1.8.0.0/bin/haskell-language-server-wrapper)
Tool versions found on the $PATH
cabal: 3.8.1.0
stack: 2.9.1
ghc: 9.4.2
Tool versions in your project
ghc: Not found
$ ghc -V
The Glorious Glasgow Haskell Compilation System, version 9.4.2
$