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

Support CompletionList.isIncomplete=true on empty lists (or at least, clearly document current behaviour) #155738

Open
DanTup opened this issue Jul 20, 2022 · 0 comments
Assignees
Labels
suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach

Comments

@DanTup
Copy link
Contributor

DanTup commented Jul 20, 2022

I was surprised to find that CompletionList.isIncomplete=true seems to be ignored when the result set is empty. The Dart server has the ability to place a maximum time on completions for not-currently-imported symbols to avoid slowing down all code completion to wait for these results (but typing further characters to narrow things down could include them).

As far as I can tell, VS Code's current behaviour of ignoring isIncomplete=true when the list is empty could be simulated by returning isIncomplete=false when the list is empty (which makes sense, logically) so this limitation feels overly-restrictive.

Additionally, the comment at #13735 (comment) suggests that this is also the case if the client-filtered list is empty. However, this is not what happens in my experience. If I insert a single item with label "FAKE" and then invoke completion with a prefix of "aaa", then isIncomplete is still honoured, and further keystrokes result in additional trips to the server.

So this is initially a request to support isIncomplete=true for empty lists, but if that's not going to change, I would at least like to see the current behaviour clearly documented (since LSP inherits this behaviour, and it's important LSP clients and servers have a good understanding of each others behaviour).

I suspect there are other people that would like to see this:

These are just the cases that mentioned the previous issue so they showed up on GitHub, I suspect there are many more.

The problem with the workaround of inserting the prefix is not just that it looks odd to users, but it doesn't work if there is no prefix. If the user hits Ctrl+Space and gets no items, the extension/server is never given any opportunity to provide completions as they type.

@jrieken jrieken added the suggest IntelliSense, Auto Complete label Oct 3, 2022
Kha added a commit to Kha/lean4 that referenced this issue Nov 26, 2022
Kha added a commit to Kha/lean4 that referenced this issue Nov 26, 2022
gebner pushed a commit to Kha/lean4 that referenced this issue Nov 28, 2022
@jrieken jrieken added the under-discussion Issue is under discussion for relevance, priority, approach label Dec 6, 2022
dos65 added a commit to dos65/metals-vscode that referenced this issue Dec 27, 2022
If Vscode receives emptuy completion list it ignores `isIncomplete` field.
Fixes: scalameta/metals#4756

Vscode issue: microsoft/vscode#155738
dos65 added a commit to dos65/metals-vscode that referenced this issue Dec 27, 2022
If Vscode receives emptuy completion list it ignores `isIncomplete` field.
Fixes: scalameta/metals#4756

Vscode issue: microsoft/vscode#155738
dos65 added a commit to dos65/metals-vscode that referenced this issue Dec 27, 2022
If Vscode receives emptuy completion list it ignores `isIncomplete` field.
Fixes: scalameta/metals#4756

Vscode issue: microsoft/vscode#155738
dos65 added a commit to scalameta/metals-vscode that referenced this issue Dec 27, 2022
)

If Vscode receives emptuy completion list it ignores `isIncomplete` field.
Fixes: scalameta/metals#4756

Vscode issue: microsoft/vscode#155738
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

2 participants