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
Clangd should respect isPreferredSupport in CodeActionClientCapabilities #573
Comments
Thanks for flagging this, sent out https://reviews.llvm.org/D90452 to address the issue. |
Thank YOU for acting so quickly on it :) |
Generally we only check capabilities when doing things that are not backwards compatible. For example:
The reason is: sending messages to exactly the schema the client negotiates, rather than a compatible one, adds more complexity and increases the support surface. And in practice we don't know that it brings any benefit. Can you explain what problem this caused? Does eglot reject messages that contain unknown properties? Any idea why this doesn't manifest with e.g. CompletionItem etc? (Strictly speaking I think this is legal per LSP as the types are specified as |
When used in "strict" mode it does that. But I doubt that OP is using it in that mode. Likely eglot just ignored the property and did nothing useful with it.
Sure about this? Is the protocol extended without adding the controlling capabilities? I don't recall examples, but I have been out of the loop for a while. |
It did cause an |
This is odd. What value do you have in |
@sam-mccall , I have to say I disagree with this: If we do as you say, the spec -- and thus the whole point of LSP -- slowly starts becoming useless. |
I can reproduce it easily with |
I've had a look @canatella , and it doesn't seem to have anything to do with |
Well all I know is that this PR fixes the problem :)
Good to know, I'll use it for next time it will certainly ease the debug process 😅 |
Since llvm/llvm-project@8392685, clangd is always sending
isPreferred
property in code action suggestions even if the matching capability iso not advertised by the client inCodeActionClientCapabilities
The text was updated successfully, but these errors were encountered: