-
Notifications
You must be signed in to change notification settings - Fork 417
completion: calculating textEdit for constructor proposals is slow #1864
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
I notice some change about LSP 3.15:
LSP 3.16:
So I think for the moment it's not breaking the protocol if we:
The proposal is to move
Commonly after resolve, |
Because how to insert E.g. taking
select 'java.sql', now you get wrong result.
Root cause:Previously when a With proposed changes above, when |
@Eskibear you're making some convenient interpretations of the spec ;-) I'm all for lazily computing expensive stuff, but this might break other clients (vim, emacs...), or at least degrade the completion UX. @mfussenegger @yyoncho what say you? |
@Eskibear here are the completionItem#resolveSupport values vscode sends to jdt.ls during initialization:
So no textEdit there. |
@fbricon Yes, you are right. The "complete insertText + resolve textEdit" approach happens to work in some cases, but the correctness is not guaranteed. I created the #1868 mainly to see how much we can improve and to restart this discussion of this issue. So far since there're some clients (e.g. vscode) supporting resolve additionalTextEdit, anohter approach is to "complete textEdit (simple name only) + resolve additionalTextEdit", as described in microsoft/vscode#96779 (comment) . E.g.
But a blocking thing is,
|
Stock neovim lsp doesn't have resolveSupport at all and the built-in completion uses There are some plugins which add |
I think #1864 (comment) answers it. It depends on the client which properties it allows and VS Code DOESN'T support resolving the text edit lazy. |
I simply think if I commit the completion before
I'm not familiar with client implementation. BUT given the fact that NONE of LSP spec and clients (vscode and vim-plugins) supports lazy reoslve text edits, I believe there must be some technical difficulties. Is there any material describing the blocking cases for me to learn from? |
Can only speak for neovim. The function/API to show completion candidates doesn't (easily) support asynchronously extending or changing completion candidates. Instead there is a function that takes a list of candidates and shows them. Currently it uses the But even if it had - or if the other APIs are used that give more flexibility,
I interpret that as " Alternatively it could first display the (potentially wrong) |
In VS Code it is used to do property prefix matching since the text edit describes the replace region in the document when applying the text edit. Without that info filtering will not work correctly |
Reopening as I closed the wrong issue (although it's related to #1846) |
Sample:
Since one type could have multiple constructors, the list of constructor proposals could be much larger than the list of type names. Calculating textEdit can be very slow for large result list.

The text was updated successfully, but these errors were encountered: