vscode-haskell icon indicating copy to clipboard operation
vscode-haskell copied to clipboard

Starting client failed

Open tifrel opened this issue 2 years ago • 5 comments

Your environment

  • macOS BigSur 11.6.2 on x86 CPU
  • VS Code 1.66.2 (Universal) Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
  • VSCode-Haskell: v2.2.0
  • GCHup 0.1.17.7
  • HLS 1.7.0.0
  • GHC 8.10.7

Steps to reproduce

  • Add VSCode-Haskell to VSCode
  • Use GHCup to install Haskell toolchain
  • Extend the path for haskell as described
  • Open a Haskell project in VSCode

Expected behaviour

  • Getting hints/lints/fmt and all the other goodies

Actual behaviour

I get an error message that starting the client failed.

Server logs:

2022-05-07 22:00:29.6950000 [client] INFO Finding haskell-language-server
2022-05-07 22:00:29.6950000 [client] INFO Searching for server executables haskell-language-server-wrapper,haskell-language-server in $PATH
2022-05-07 22:00:29.6950000 [client] INFO $PATH environment variable: ~/.local/share/npm/bin:~/.local/share/zinit/polaris/bin:/opt/local/sbin:/opt/local/bin:~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/.cargo/bin
2022-05-07 22:00:29.6980000 [client] INFO Found server executable in $PATH: haskell-language-server-wrapper
2022-05-07 22:00:29.6980000 [client] INFO Activating the language server in working dir: ~/sandbox/haskell (the workspace folder)
2022-05-07 22:00:29.6990000 [client] INFO run command: haskell-language-server-wrapper --lsp
2022-05-07 22:00:29.6990000 [client] INFO debug command: haskell-language-server-wrapper --lsp
2022-05-07 22:00:29.6990000 [client] INFO server environment variables:
2022-05-07 22:00:29.6990000 [client] INFO   PATH=${HOME}/.ghcup/bin:${PATH}
2022-05-07 22:00:29.7050000 [client] INFO Starting language server
[Error - 23:00:29] Starting client failed
Launching server using command haskell-language-server-wrapper failed.

Include debug information

Output of haskell-language-server-wrapper --debug

Exit codes:

  • haskell-language-server-wrapper: 14
  • haskell-language-server-wrapper --debug: 14

tifrel avatar May 07 '22 22:05 tifrel

Try with an explicit cradle as file hie.yaml in your project with the following contents:

cradle:
  cabal:

hasufell avatar May 07 '22 22:05 hasufell

Try with an explicit cradle as file hie.yaml in your project with the following contents:

Neither hie.yaml, nor hie.yml work. Do I need to fill the cabal field somehow?

tifrel avatar May 07 '22 22:05 tifrel

Try with an explicit cradle as file hie.yaml in your project with the following contents:

Neither hie.yaml, nor hie.yml work. Do I need to fill the cabal field somehow?

Can you be more specific? What's the error?

hasufell avatar May 07 '22 22:05 hasufell

Can you be more specific? What's the error?

The same as above in VS Code:

2022-05-07 22:37:33.9270000 [client] INFO Starting language server
[Error - 23:37:33] Starting client failed
Launching server using command haskell-language-server-wrapper failed.

In the terminal however:

Failed to get project GHC version: CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitFailure 1, cradleErrorStderr = ["Error when calling cabal exec -v0 -- ghc --print-libdir","","No cabal.project file or cabal file matching the default glob './*.cabal' was found.\nPlease create a package description file <pkgname>.cabal or a cabal.project file referencing the packages you want to build.\n\n"]}

It might be useful to know that I am not trying to create a bigger project, just playing around with Haskell.

tifrel avatar May 07 '22 22:05 tifrel

You haven't created a project. Follow https://www.haskell.org/ghcup/steps/#creating-a-proper-package-with-modules

hasufell avatar May 08 '22 06:05 hasufell

Closed for inactivity

fendor avatar Dec 05 '22 09:12 fendor