-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide the popup in async mode when there are no completions left
Fix bug a introduced in 78fc9f6 that prevented the popup from closing when there are were completions left. In addition, create the variable stillComputing earlier so that it can be reused.
- Loading branch information
1 parent
4fc8a17
commit be9ac16
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,9 +244,10 @@ private void computeAndPopulateProposals(int offset, Consumer<List<ICompletionPr | |
if (offset != fInvocationOffset || fComputedProposals != requestSpecificProposals) { | ||
return; | ||
} | ||
boolean stillComputing= fComputedProposals.contains(computingProposal); | ||
if (autoInsert | ||
&& !autoActivated | ||
&& !fComputedProposals.contains(computingProposal) | ||
&& !stillComputing | ||
&& fComputedProposals.size() == 1 | ||
&& remaining.get() == 0 | ||
&& canAutoInsert(fComputedProposals.get(0))) { | ||
|
@@ -256,18 +257,17 @@ && canAutoInsert(fComputedProposals.get(0))) { | |
} | ||
return; | ||
} | ||
if (!fComputedProposals.contains(computingProposal) && callback != null) { | ||
if (!stillComputing && callback != null) { | ||
callback.accept(fComputedProposals); | ||
} else { | ||
boolean stillComputing= fComputedProposals.contains(computingProposal); | ||
boolean hasProposals= (stillComputing && fComputedProposals.size() > 1) | ||
|| (!stillComputing && !fComputedProposals.isEmpty()); | ||
|
||
if ((autoActivated && hasProposals) || !autoActivated) { | ||
setProposals(fComputedProposals, false); | ||
displayProposals(true); | ||
} else if (isValid(fProposalShell) && !fProposalShell.isVisible() && remaining.get() == 0) { | ||
hide(); // we only tear down if the popup is not visible. | ||
} else if (isValid(fProposalShell) && fProposalShell.isVisible() && remaining.get() == 0) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mickaelistria
Contributor
|
||
hide(); // we only tear down if the popup is visible. | ||
} | ||
} | ||
}); | ||
|
@mickaelistria , after going to the code again, I think now this was mistake.
hide()
was stopping the timer that I want to fix now, not just hiding the popup.I will test again tomorrow, but I think the condition should be reverted in my new PR.