mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add some checkCanceled to async console filters (IDEA-163365)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user