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

ResolveCompletionItem is called on each keystroke #48619

Closed
mjbvz opened this issue Apr 25, 2018 · 6 comments
Closed

ResolveCompletionItem is called on each keystroke #48619

mjbvz opened this issue Apr 25, 2018 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug suggest IntelliSense, Auto Complete verified Verification succeeded
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Apr 25, 2018

Steps to Reproduce:

  1. Set "typescript.tsserver.trace": "messages"
  2. In a js file:
function fooooooooooooo() { }

foo
  1. Trigger suggestions at end of foo and start typing

Bug
In the typescript output panel, notice multiple completionEntryDetails calls in the logs as you type. This is caused by vs code calling resolveCompletionItem on the same item again for each keystroke

@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Apr 25, 2018
@mjbvz mjbvz added this to the April 2018 milestone Apr 25, 2018
@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Apr 25, 2018

This has been happening for over a year.

The root cause, is that the variable tracking the current focused item is reset. This was done in a35c7da. @joaomoreno Do you recall the reason for this change?

I would suggest the fix to be ac12c69, but am not sure if we should take this for April

@ramya-rao-a ramya-rao-a added the suggest IntelliSense, Auto Complete label Apr 25, 2018
@joaomoreno
Copy link
Member

My commit message and related issue #23408 seem to be very helpful. I can't even imagine how broken it was 🐛

Serious now: I'm not sure. The suggest widget used to narrow down suggestions by itself, without asking the provider to narrow down, except if the provider returns an incomplete result. I can only reason that in that case, showSuggestions would only be called on the initial population of results; while further "narrow downs" wouldn't pass through that code pass. It seems that even narrowing down now uses showSuggestions, so that assumption is misleading.

@ramya-rao-a
Copy link
Contributor

@jrieken thoughts?

@jrieken
Copy link
Member

jrieken commented Apr 26, 2018

Don't reset the item when it's the same completion model?

@ramya-rao-a
Copy link
Contributor

That works. Pushing this to May as there is no visible user impact of this issue.

@ramya-rao-a ramya-rao-a modified the milestones: April 2018, May 2018 Apr 26, 2018
@RMacfarlane RMacfarlane added the verified Verification succeeded label May 31, 2018
ramya-rao-a added a commit that referenced this issue Jun 8, 2018
…when there are completions of the incomplete kind
@ramya-rao-a
Copy link
Contributor

Don't reset the item when it's the same completion model?

The completion model differs for each keystroke if there is a completion provider giving result of the incomplete kind. So checking the completion model doesn't always work

Pushed another fix 2e0a564 which doesn't rely on the completion model.

Moving this bug for June for another round of verification.

@ramya-rao-a ramya-rao-a removed the verified Verification succeeded label Jun 8, 2018
@ramya-rao-a ramya-rao-a modified the milestones: May 2018, June 2018 Jun 8, 2018
@mjbvz mjbvz added the verified Verification succeeded label Jun 28, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug suggest IntelliSense, Auto Complete verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants