-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
LSP 3.16: Consider implementing completionItem/resolve #6366
Comments
What is a good way to understand this? I see this when RA starts and gets info from VSCode:
in the completion capabilities, in Rust code this is pub struct CompletionItemCapabilityResolveSupport {
/// The properties that a client can resolve lazily.
pub properties: Vec<String>,
} Is it all right to check this vec for |
You will need to check if this exists: https://github.com/gluon-lang/lsp-types/blob/master/src/completion.rs#L109 and see what the properties are that it supports. The vscode client is filled out like so: https://github.com/microsoft/vscode-languageserver-node/blob/fde994bb4e29518a1988d0070e3f160146135021/client/src/common/client.ts#L1514 |
Yes. I would hang something off of our config infra that says what we can resolve lazily and check that when computing the completion. Then that could be deferred. We may need to make it generic for all completions (I haven't looked at our completion infrastructure in a while). |
Oh... we also need to advertise server-side support by filling in |
Yep, the server side is covered, but the client side is a bit obscure tbh. Thank you for the advices. |
It is awkward. You have to read https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#textDocument_completion a bunch. From my understanding it works like this (assuming that the server advertises resolve) on LSP < 3.16:
On LSP 3.16+ step 3 is different IF the client fills in |
6706: Move import text edit calculation into a completion resolve request r=matklad a=SomeoneToIgnore Part of #6612 (presumably fixing it) Part of #6366 (does not cover all possible resolve capabilities we can do) Closes #6594 Further improves imports on completion performance by deferring the computations for import inserts. To use the new mode, you have to have the experimental completions enabled and use the LSP 3.16-compliant client that reports `additionalTextEdits` in its `CompletionItemCapabilityResolveSupport` field in the client capabilities. rust-analyzer VSCode extension does this already hence picks up the changes completely. Performance implications are descrbed in: #6633 (comment) Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Thanks for doing this! I don't think we need to support |
I was just about to write a set of instructions on what to do next here, thanks for saving my time. |
@SomeoneToIgnore feel free to open a new issue about enhancing this exciting and thrilling feature! If you have thoughts on improvements or specific instructions we probably shouldn't lose them. |
If the client supports it we should implementing completionItem/resolve
The text was updated successfully, but these errors were encountered: