Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiko Stotz2020-02-20 22:19:43 +0000
committerNiko Stotz2020-03-21 10:25:49 +0000
commita9c88ab4cece3029863484d4f9343da20b391b10 (patch)
tree34e88e29fc1e3d93cee604bade17bc623f4705be
parente4d7244be1ff772f7238f9d96345fc521ebfd7ce (diff)
downloadeclipse.platform.text-a9c88ab4cece3029863484d4f9343da20b391b10.tar.gz
eclipse.platform.text-a9c88ab4cece3029863484d4f9343da20b391b10.tar.xz
eclipse.platform.text-a9c88ab4cece3029863484d4f9343da20b391b10.zip
Change-Id: I6a665e89814ff4403474428e3142e8e50b173f30 Signed-off-by: Niko Stotz <eclipse@nikostotz.de>
-rw-r--r--org.eclipse.ui.editors/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java30
2 files changed, 27 insertions, 5 deletions
diff --git a/org.eclipse.ui.editors/META-INF/MANIFEST.MF b/org.eclipse.ui.editors/META-INF/MANIFEST.MF
index 8067652ad..35c9e7040 100644
--- a/org.eclipse.ui.editors/META-INF/MANIFEST.MF
+++ b/org.eclipse.ui.editors/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ui.editors; singleton:=true
-Bundle-Version: 3.13.100.qualifier
+Bundle-Version: 3.13.200.qualifier
Bundle-Activator: org.eclipse.ui.internal.editors.text.EditorsPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java
index ed6be29f2..7e14e2f77 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/codemining/annotation/AnnotationCodeMiningProvider.java
@@ -16,6 +16,8 @@ package org.eclipse.ui.internal.editors.text.codemining.annotation;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
+import java.util.Timer;
+import java.util.TimerTask;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.stream.Collectors;
@@ -101,6 +103,23 @@ public class AnnotationCodeMiningProvider extends AbstractCodeMiningProvider
* Updates code minings after changes to annotations.
*/
private class AnnotationModelListener implements IAnnotationModelListener, IAnnotationModelListenerExtension {
+ private final class RemoveCodeMiningTimerTask extends TimerTask {
+ @Override
+ public void run() {
+ getCodeMiningViewer().updateCodeMinings();
+ removeTimer= null;
+ }
+ }
+
+ private Timer removeTimer;
+
+ private void scheduleTimer() {
+ if (removeTimer == null) {
+ removeTimer= new Timer("Remove Code Mining Annotations");
+ removeTimer.schedule(new RemoveCodeMiningTimerTask(), 111);
+ }
+ }
+
@Override
public void modelChanged(@Nullable IAnnotationModel model) {
// ignore
@@ -116,12 +135,15 @@ public class AnnotationCodeMiningProvider extends AbstractCodeMiningProvider
return;
}
- AnnotationCodeMiningFilter filter= new AnnotationCodeMiningFilter(getAnnotationAccess(),
- event.getAddedAnnotations(), event.getRemovedAnnotations(), event.getChangedAnnotations());
-
- if (!filter.isEmpty()) {
+ AnnotationCodeMiningFilter addChangeFilter= new AnnotationCodeMiningFilter(getAnnotationAccess(), event.getAddedAnnotations(), event.getChangedAnnotations());
+ if (!addChangeFilter.isEmpty()) {
getCodeMiningViewer().updateCodeMinings();
}
+
+ AnnotationCodeMiningFilter removeFilter= new AnnotationCodeMiningFilter(getAnnotationAccess(), event.getRemovedAnnotations());
+ if (!removeFilter.isEmpty()) {
+ scheduleTimer();
+ }
}
}

Back to the top