Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java
index ce724dd97..e39bc2f30 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/AsyncCompletionProposalPopup.java
@@ -224,16 +224,18 @@ class AsyncCompletionProposalPopup extends CompletionProposalPopup {
fComputedProposals.add(0, computingProposal);
setProposals(fComputedProposals, false);
AtomicInteger remaining= new AtomicInteger(populateFutures.size());
+ final List<ICompletionProposal> requestSpecificProposals= fComputedProposals; //fComputedProposals can be changed/reset later
populateFutures= populateFutures.stream().map(future -> future.thenRun(() -> {
computingProposal.setRemaining(remaining.decrementAndGet());
if (remaining.get() == 0) {
- fComputedProposals.remove(computingProposal);
+ requestSpecificProposals.remove(computingProposal);
}
Control control= fContentAssistSubjectControlAdapter.getControl();
if (!control.isDisposed() && offset == fInvocationOffset) {
control.getDisplay().asyncExec(() -> {
- // Don't run anything if offset has changed while runnable was scheduled (i.e. filtering might have occurred for fast CA)
- if (offset != fInvocationOffset) {
+ // Skip if offset has changed while runnable was scheduled
+ // nor when completion "session" was modified or canceled.
+ if (offset != fInvocationOffset || fComputedProposals != requestSpecificProposals) {
return;
}
if (autoInsert

Back to the top