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

LSP: Resolve completion items when any info is missing #10873

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

the-mikedavis
Copy link
Member

Rust-analyzer for example sends Some([]) for completion items and then sends the actual additional text edits in the completionItem/resolve response.

Fixes #10787

@the-mikedavis the-mikedavis added C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much A-language-server Area: Language server client S-waiting-on-review Status: Awaiting review from a maintainer. labels Jun 3, 2024
@pascalkuthe
Copy link
Member

I think we likely need to do something similar for detail and documentation. I think this is a case where null and empty list/empty string satsify the same condition in vscode/JavaScript so a lot of lsps usw them interchangibly

Rust-analyzer for example sends `Some([])` for completion items and then
sends the actual additional text edits in the completionItem/resolve
response. To be defensive we also guard against language servers sending
empty details and documentation.
@the-mikedavis the-mikedavis force-pushed the lsp-resolve-with-empty-additional-text-edits branch from fe3b99f to f71cee8 Compare June 3, 2024 13:37
@the-mikedavis the-mikedavis changed the title LSP: Resolve completion items when additional text edits are empty LSP: Resolve completion items when any info is missing Jun 3, 2024
|| item.item.detail.is_none()
|| item.item.additional_text_edits.is_none();
if !needs_resolve {
// We consider an item to be fully resolved if it has non-empty, none-`None` details,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is none- supposed to be non-? Or is this implying something else?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that's a typo, should be "non-None"

@archseer archseer merged commit 6f1437e into master Jun 6, 2024
6 checks passed
@archseer archseer deleted the lsp-resolve-with-empty-additional-text-edits branch June 6, 2024 04:28
Vulpesx pushed a commit to Vulpesx/helix that referenced this pull request Jun 7, 2024
smortime pushed a commit to smortime/helix that referenced this pull request Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much S-waiting-on-review Status: Awaiting review from a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LSP fail to auto-complete the import
4 participants