-
Notifications
You must be signed in to change notification settings - Fork 841
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
Specify that an editor should fallback to unresolved code action if resolve request fails #2112
base: gh-pages
Are you sure you want to change the base?
Specify that an editor should fallback to unresolved code action if resolve request fails #2112
Conversation
…esolve request fails
@mjbvz can you please comment on what the current default behavior in VS Code is in this sceanrio? |
This is a huge change in spec. And it's not even intuitive. If the resolve fails the code action failed. |
Yeah I'm inclined to say that we should surface this error to the user so they can report it. Ia actually thought that's what we were doing on the VS Code side by calling But it turns out we end up silently catching the error @justschen Want to try changing our code to alert when resolve fails? |
I think part of the problem here is that while the client can announce which properties it can resolve via the So if the client says it can resolve both Not having this fallback mechanism causes at least issues with the haskell-language-server (neovim/neovim#25464) and ruby-lsp (neovim/neovim#32757) |
My expectation would be :
I don't think there should be fallbacks. Instead the states would be:
|
@mjbvz that sounds reasonable to me. However, I think that we should apply the same logic to other requests that also have a resolve step. Take completions for example: Based on this snippet, it seems like VS Code uses the unresolved item when the resolve request fails. Shouldn't we extend this idea there too? The main motivation behind this PR isn't about falling back or not, but to specify in the LSP what should be the correct editor behavior when resolve fails, as it's unclear whether language servers should handle a potentially unexpected code action argument in |
I fully agree with @mjbvz comment here: #2112 (comment) @mfussenegger the only scenario I can currently see for server's to announce what they can resolve is performance since we could save an additional server roundtrip. If this really becomes a problem I would instead add a tag/ property to the code action indicating that it is already fully resolved so that clients can avoid the round trip. |
@MariaSolOs I think it needs thought on a case by case basis For code actions, However for completions, |
@mjbvz sounds good. As long as we document when/how to fallback in the spec to have consistent experiences across editors, I'm fine with that. |
VS Code, Helix and (soon) Neovim all fallback to the original code action when resolve fails.
To avoid issues like neovim/neovim#32757 where it's unclear what an editor should do in the scenario where the language server errors when resolving the code action, let's specify what the standard behavior should be.