-
Notifications
You must be signed in to change notification settings - Fork 417
Get rid of the duplicated COMPLETION_EXECUTION_TIME in completion items #2635
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
Conversation
- Now, the server will cache the COMPLETION_EXECUTION_TIME and only set it into the data field when the item is selected in the callback function. Signed-off-by: sheche <[email protected]>
This comment was marked as off-topic.
This comment was marked as off-topic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm this PR eliminates the the COMPLETION_EXECUTION_TIME
from each completion item. It looks like this makes it so that if a client wants access to the completion execution time, they must contribute an ICompletionRankingProvider
(presumably in a JDT-LS bundle contribution) to get access to it ?
Initially I was thinking, you would probably just return the execution time in the data
field of the response to resolveCompletionItem
. But I guess the wording of the data
field implies it should not exist after resolve ?
/**
* A data entry field that is preserved on a completion item between
* a completion and a completion resolve request.
*/
data?: [LSPAny](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#lspAny);
If that's the reason you went with reporting the values through java.completion.onDidSelect
and only when a ranking provider is contributed, then feel free to merge. I just thought maybe there's a nicer way that uses less non-spec stuff.
Ah yes, those concerns do make sense.
Yes, that's the original intention to introduce
I'm not worry about it, because The discussion makes me thinking that: Is putting the execution time into the completion item's data field a good practice? Maybe we should make it part of the |
The ranking provider may add many data properties to the completion items. You can store the data from ranking providers in the internal CompletionResponse cache instead of merging them to the lsp4j completion items. This will reduce duplication in the lsp4j response result. |
Thanks for the input. Yes, IntelliCode contributes some other data entries which are now added into the |
Signed-off-by: Sheng Chen <[email protected]>
fix #2621
Data size change
Triggering completion via 'S' in Spring Petclinic project, the response (textDocument/completion) data size can be reduced from 2.67MB to 2.54MB. (Directly copy the trace to a text file)