haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 210 forks source link

hie-wrapper (via coc.nvim) continually crashes #1753

Closed gfarrell closed 4 years ago

gfarrell commented 4 years ago

I'm using coc.nvim as my LSP client (within neovim) -- it works with other languages. I have removed Setup.hs, installed hspec-discover globally to fix problems with HIE, but now I'm at the stage where the server just continually dies and gets restarted.

I have tried a basic hie.yaml in the project root (the project is gfarrell/random-puzzles-hs):

cradle:
  stack:

But this also doesn't work.

> stack ide packages --cabal-files --stdout                                                      
/Users/gideon/projects/challenges/random-puzzles/random-puzzles.cabal

When I look at the output of hie-wrapper (via CocList > output > languageserver.haskell) I get the following (repeated ad nauseam, so I just took a selection):

hie.log

I can't work out why it's continually restarted. I tried hie-wrapper --debug in the project root and got the following output which seems to imply that nothing is wrong with the project:

hie-debug.log

fendor commented 4 years ago

Thank you for your bug report! I think you may be missing the --lsp flag for hie.

gfarrell commented 4 years ago

Ah finally, thank you. That worked!

Some commentary about this:

  1. I was previously using the config in the Coc Wiki but this wasn't working for me because of the following other issues: a. stack new creates Setup.hs which seems to break hie. b. I'm using hspec for tests, and hspec-discover has to be globally installed, but this error wasn't showing for me. I found it after solving some other issues. c. I kept seeing cabal-install is not installed, even though I'm using stack not cabal (although this is no-longer happening to me even if I remove hie.yaml). d. Maybe other issues?
  2. I found this error super hard to debug.
fendor commented 4 years ago

stack new creates Setup.hs which seems to break hie

No, it just cant be loaded, HIE should continue to work.

I'm using hspec for tests, and hspec-discover has to be globally installed,

Yeah, for now it gotta be like that. Until we have abstracted build-tools and have a way to query the path for each tool.

I found this error super hard to debug.

Reasonable, we should add a message to the beginning of the output in HieMain.hs