Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tutorial stack template is crashing lsp server in emacs #1559

Closed
MikHulk opened this issue Mar 12, 2022 · 2 comments
Closed

tutorial stack template is crashing lsp server in emacs #1559

MikHulk opened this issue Mar 12, 2022 · 2 comments
Labels

Comments

@MikHulk
Copy link

MikHulk commented Mar 12, 2022

Hi,

I tried to do the tutorial here https://docs.servant.dev/en/stable/tutorial/ApiType.html#

When I create a new project with stack:

$ stack new test-servant servant

I get this layout:

test-servant
├── LICENSE
├── README.md
├── Setup.hs
├── app
│   └── Main.hs
├── package.yaml
├── src
│   └── Lib.hs
├── stack.yaml
├── stack.yaml.lock
├── test
│   └── Spec.hs
└── test-servant.cabal

If I try to open Lib.hs with emacs. The LSP server crash immediately with this error :

No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.1.0 x86_64 ghc-8.10.7
Current directory: /Users/moi/Dev/Haskell/test-servant
Operating system: darwin
Arguments: ["--lsp","-d","-l","/var/folders/2k/p5hpgh1j4k55pxn46_msslsm0000gn/T/hls.log"]
Cradle directory: /Users/moi/Dev/Haskell/test-servant
Cradle type: Stack

Tool versions found on the $PATH
cabal:		3.6.2.0
stack:		2.7.3
ghc:		8.10.7


Consulting the cradle to get project GHC version...
Failed to get project GHC version:CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitFailure 1, cradleErrorStderr = ["Error when calling stack setup --silent","",""]}

I don't know if this issue is related to the template or haskell lsp server.

@byorgey
Copy link

byorgey commented Mar 12, 2022

Possibly related? haskell/haskell-language-server#2224 Try removing .ghc/blahblah/environments/default . That has worked for me in the past when I've encountered similar issues.

@MikHulk
Copy link
Author

MikHulk commented Mar 12, 2022

Thank you indeed it works. I don't know why. But it works.

@gdeest gdeest closed this as completed Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants