-
Notifications
You must be signed in to change notification settings - Fork 167
WIP - Get more detailed completions by default #167
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is IMO risky as completions are not re-requested when you are narrowing your completion results. So if we exclude something initially, it will be unavailable even if the user narrows down his query.
Due to that, all those optimizations should be optional IMO. Better to be correct than shaving some milliseconds.
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.
It's not just a matter of shaving milliseconds, the LSP server in neovim has been having issues handling large payloads, leading to freezes and OOM issues; see this issue.
But I agree that arbitrarily limiting results is risky, people need to trust that they are seeing all available completion items.
Maybe a good middle ground would be to visually indicate to the user that the list has been truncated? ie. adding a
<RESULTS TRUNCATED>
item to the completion list; I know this sucks but I'm not sure there is a better way.Uh oh!
There was an error while loading. Please reload this page.
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.
For servers that are likely to return a lot of completions it's OK to limit but then also use the
isIncomplete
flag so that completions are re-requested on query change.So that could be the solution here too - add a flag that enables the use of
isIncomplete
option and limiting the results. But that would likely require more effort to implement.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.
Good points and thanks for the feedback!
To be clear, this limit doesn't change the total number of candidates completed: it only makes those candidates less detailed. I'm finding it's needed (and I probably need to make the default smaller) because of a compounding issue with as-you-type completions. Sometimes a completion that is more broad (ie user types
co
) will return after a more specific query (ie user continues typingconsole.
).I need to do a little more research into how this is handled on other servers. I know our cancellation story is pretty rough right now, but I don't know that it would handle this specific situation.
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't see how we can come up with a good solution for this issue. Even if we would use the
isIncomplete
flag and limit number of completions, that could result in client missing some completion that he wanted to use. It would likely come on typing another characters but for some (maybe all) editors the completion popup might already be dismissed since there were no matching completions.Also, with the
isIncomplete
flag we would trade the initial heavy completions with a need to request completions on every typed character which would make things worse for editors that currently don't struggle with large number of completions.So IMO this PR should be closed.