add some checkCanceled to async console filters (IDEA-163365)
authorpeter <peter@jetbrains.com>
Thu, 3 Nov 2016 09:25:43 +0000 (10:25 +0100)
committerpeter <peter@jetbrains.com>
Thu, 3 Nov 2016 09:53:15 +0000 (10:53 +0100)
platform/lang-api/src/com/intellij/execution/filters/CompositeFilter.java
platform/platform-impl/src/com/intellij/execution/impl/AsyncFilterRunner.java

index e659920d6a51a581bfe087991200a70f32a7c10f..dd2cdac55f2b3c64962af538801ac7d4cf774767 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.execution.filters;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.progress.ProcessCanceledException;
+import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.openapi.project.DumbService;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.TextRange;
@@ -54,6 +55,7 @@ public class CompositeFilter implements Filter, FilterMixin {
 
     List<ResultItem> resultItems = null;
     for (int i = 0; i < count; i++) {
+      ProgressManager.checkCanceled();
       Filter filter = filters.get(i);
       if (!dumb || DumbService.isDumbAware(filter)) {
         long t0 = System.currentTimeMillis();
index 183dc14630f230002908a0f28db609f81c3c73a1..53fa4cd40fc0abaa93e801d111b71a21dbae7cf1 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.RangeMarker;
+import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.openapi.progress.util.ProgressIndicatorUtils;
 import com.intellij.openapi.util.Computable;
 import com.intellij.openapi.util.NullableComputable;
@@ -133,6 +134,7 @@ class AsyncFilterRunner {
     return () -> {
       List<Filter.Result> results = new ArrayList<>();
       for (LineHighlighter task : tasks) {
+        ProgressManager.checkCanceled();
         if (!marker.isValid()) return FilterResults.EMPTY;
         ContainerUtil.addIfNotNull(results, task.compute());
       }