Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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