mpickering/ghcide

Improve ghc session error handling

Closed this issue · 6 comments

  • If cradle run is succesful but ghc session crashes the ide does not get any error and progress gets stuck
  • The workaround is extract compiler args and call ghc directly on command line to see what is going on
  • Detected when opening ghc with hls on windows but i think the behaviour is similar with other projects

@jneira The way to fix this is the make optsGhcSession return Either [Diagnostic] HscEnvEq and then exe/Main can report a proper diagnostic on failure.

I have a patch for this now.

This hie-bios issue would make it better - haskell/hie-bios#185

@mpickering i am afraid that the original issue finally was not fixed by #32. It handles errors running the cradle but the behaviour described was due to a failed ghc session caused by bad ghc args returned by a succesful cradle

I'll reopen it if you dont mind

Sure, I didn't mean to close this issue.

It seems in linux the ghc init session error is being shown in the output (see haskell/haskell-language-server#121 (comment)) so the situation is slightly better than on windows