Skip to content
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

[Improvement]: Improve Language Server Completions with completionItem/resolve #41223

Open
malinthar opened this issue Aug 16, 2023 · 1 comment
Assignees
Labels
Area/Completion Issues related to Language Server Auto Completions Priority/Low Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Improvement

Comments

@malinthar
Copy link
Contributor

Description

LS auto completions takes a long time to respond when the project is relatively large and the compilation is fairly large. We can now use the CompletionItemResolve (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionItem_resolve) request to compute the text edit separately.

This is quite simillar to the codeActionResolve request implemented in the Ballerina Language Server. With this we can provide fast completions even if the project is quite large.

Describe your problem(s)

No response

Describe your solution(s)

No response

Related area

-> Compilation

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@malinthar malinthar added Type/Improvement Team/LanguageServer Language Server Implementation related issues. #Compiler Area/Completion Issues related to Language Server Auto Completions labels Aug 16, 2023
@malinthar malinthar changed the title [Improvement]: Improve Language Server Completions with completion/resolve [Improvement]: Improve Language Server Completions with completionItem/resolve Aug 16, 2023
@ballerina-bot ballerina-bot added needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Aug 16, 2023
@nipunayf nipunayf moved this from BackLog to In Progress in Ballerina Team Main Board Mar 7, 2024
@nipunayf nipunayf moved this from In Progress to BackLog in Ballerina Team Main Board Mar 7, 2024
@nipunayf nipunayf removed needTriage The issue has to be inspected and labeled manually userCategory/Compilation labels Mar 7, 2024
@nipunayf nipunayf self-assigned this Mar 8, 2024
@nipunayf nipunayf moved this from BackLog to Planned for Sprint in Ballerina Team Main Board Mar 8, 2024
@nipunayf nipunayf moved this from Planned for Sprint to In Progress in Ballerina Team Main Board Mar 11, 2024
@nipunayf nipunayf added the Later label Mar 11, 2024
@nipunayf
Copy link
Contributor

The response time for retrieving completion items is determined by the execution times of both APIs: didChange (which heavily includes updating the project) and completions APIs (which includes the computation of the completion items). After measuring the performance of retrieving the completions for the project https://github.com/ballerina-platform/module-ballerinax-health.fhir.r4, it was found that for a majority of the samples, the performance delay was bound by updating the project rather than the latter. However, for instances that include a high number of completion items, the completions API took a major fraction of the performance delay (around 80%). Ideally, it would be nice to have this feature to address such cases; however, for now, the issue is labeled to do later since the gain in performance does not outweigh the effort put in.

@nipunayf nipunayf moved this from In Progress to On Hold in Ballerina Team Main Board Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Completion Issues related to Language Server Auto Completions Priority/Low Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Improvement
Projects
Status: On Hold
Development

No branches or pull requests

3 participants