-
-
Notifications
You must be signed in to change notification settings - Fork 391
dont propose to restart ghc when not available #4006
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
Comments
Yes, I think there is a knob in the spec. We can set the error data on the response error that we send to the initialize request with a field to say whether or not the client should retry. I think the default assumption is "yes", so it's probably helpful to explicitly say "no" since probably that's usually the right answer. |
I'm actually not sure there are any errors where we want the client to blindly restart? |
The intention of this command was to give users some time to look at the error, fix their environment, and then press "try to restart". Previously, vscode would just restart HLS 5 times, fail and then show an additional error message over our own, distracting further from the issue at hand. I don't have an issue with adding a setting to disable the current behaviour, but I do think the "try to restart" should stay the default. |
Could this be configured through initializationOptions ? initializeParams I dont mind the warning, just the prompt that steals focus. |
Huh, so it's actually something we send and not automatic retry handling by the client? Then ignore everything I said 😂 |
Not trivially, in the case of setup errors, e.g. the wrapper had to error out before finding the correct HLS version, we are not handling the initialiseOptions but only send that request. See #2589 for a little bit of context for that feature. |
Is your enhancement request related to a problem?
I have almost nothing in my global PATH and configure tooling on a per-project basis.
Only when entering a development shell (via
nix develop
), I get my LSP, compilers etc. available.My current issue is that whenever I open my haskell projects with neovim for a quick look/edit without entering the nix-shell, I get this annoying popup "Failed to find the GHC version of this Cabal project.". This takes the focus and thus I first have to escape the prompt before doing anything. Restarting is bound to fail as there is no ghc in PATH
Describe the solution you'd like
I would like to be able to disable the prompt but still get the error. If there is a LSP knob for that, it should be in hls but maybe it's something to configure in neovim, I am not sure yet.
Describe alternatives you've considered
None
Additional context
First (wrongly) reported at
mrcjkb/haskell-tools.nvim#338 (comment)
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initializeError
The text was updated successfully, but these errors were encountered: