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/completions: Implement better package items #763

Merged
merged 2 commits into from
May 29, 2024

Conversation

charlieegan3
Copy link
Member

@charlieegan3 charlieegan3 commented May 28, 2024

Items for packages will now be sorted by 'depth',
show partial package refs where a package is comprised of many sub packages and continuously trigger completions in order to be able to provide up-to-date suggestions based on file changes.

Fixes #752

before

before.mov

after

Screen.Recording.2024-05-28.at.16.54.59.mov

@@ -701,7 +701,7 @@ func (l *LanguageServer) handleTextDocumentCompletion(
}

return types.CompletionList{
IsIncomplete: false,
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a key part of the change here which has the client request completions on each char change. This allows the server to define the completions and filtering them.

Copy link
Member

Choose a reason for hiding this comment

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

Niiiice!

@charlieegan3
Copy link
Member Author

This PR also has a fix for not showing completions on lines starting with \t etc.

453b99e

Items for packages will now be sorted by 'depth',
show partial package refs where a package is comprised of
many sub packages and continuously trigger completions
in order to be able to provide up-to-date suggestions based on file
changes.

Signed-off-by: Charlie Egan <[email protected]>
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

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

Code looks good to me! I'll test on main once it's merged.

@@ -701,7 +701,7 @@ func (l *LanguageServer) handleTextDocumentCompletion(
}

return types.CompletionList{
IsIncomplete: false,
Copy link
Member

Choose a reason for hiding this comment

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

Niiiice!

@anderseknert anderseknert merged commit 285a12d into StyraInc:main May 29, 2024
3 checks passed
srenatus pushed a commit to srenatus/regal that referenced this pull request Oct 1, 2024
Items for packages will now be sorted by 'depth',
show partial package refs where a package is comprised of
many sub packages and continuously trigger completions
in order to be able to provide up-to-date suggestions based on file
changes.

Signed-off-by: Charlie Egan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completions: huge list of completion suggestions seemingly arbitrary filtered
2 participants