mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not change editor during batch inspection
This commit is contained in:
+3
-3
@@ -673,9 +673,9 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP
|
||||
analyzeByVisitors(progress, visitors, holder, 0, action);
|
||||
}
|
||||
|
||||
private void killAbandonedHighlightsUnder(@NotNull final TextRange range,
|
||||
@NotNull final HighlightInfoHolder holder,
|
||||
@NotNull final ProgressIndicator progress) {
|
||||
protected void killAbandonedHighlightsUnder(@NotNull final TextRange range,
|
||||
@NotNull final HighlightInfoHolder holder,
|
||||
@NotNull final ProgressIndicator progress) {
|
||||
DaemonCodeAnalyzerImpl.processHighlights(getDocument(), myProject, null, range.getStartOffset(), range.getEndOffset(), new Processor<HighlightInfo>() {
|
||||
@Override
|
||||
public boolean process(final HighlightInfo existing) {
|
||||
|
||||
+9
-2
@@ -19,10 +19,10 @@ package com.intellij.codeInspection;
|
||||
import com.intellij.codeHighlighting.HighlightDisplayLevel;
|
||||
import com.intellij.codeInsight.daemon.impl.*;
|
||||
import com.intellij.codeInsight.daemon.impl.analysis.HighlightInfoHolder;
|
||||
import com.intellij.codeInsight.intention.IntentionAction;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
@@ -158,6 +158,7 @@ public abstract class DefaultHighlightVisitorBasedInspection extends GlobalSimpl
|
||||
final Project project = file.getProject();
|
||||
Document document = PsiDocumentManager.getInstance(project).getDocument(file);
|
||||
if (document == null) return;
|
||||
final HighlightInfoFilter[] filters = ApplicationManager.getApplication().getExtensions(HighlightInfoFilter.EXTENSION_POINT_NAME);
|
||||
GeneralHighlightingPass pass =
|
||||
new GeneralHighlightingPass(project, file, document, 0, file.getTextLength(), true) {
|
||||
@NotNull
|
||||
@@ -168,7 +169,6 @@ public abstract class DefaultHighlightVisitorBasedInspection extends GlobalSimpl
|
||||
|
||||
@Override
|
||||
protected HighlightInfoHolder createInfoHolder(final PsiFile file) {
|
||||
final HighlightInfoFilter[] filters = ApplicationManager.getApplication().getExtensions(HighlightInfoFilter.EXTENSION_POINT_NAME);
|
||||
return new HighlightInfoHolder(file, getColorsScheme(), filters){
|
||||
@Override
|
||||
public boolean add(@Nullable HighlightInfo info) {
|
||||
@@ -182,6 +182,13 @@ public abstract class DefaultHighlightVisitorBasedInspection extends GlobalSimpl
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void killAbandonedHighlightsUnder(@NotNull TextRange range,
|
||||
@NotNull HighlightInfoHolder holder,
|
||||
@NotNull ProgressIndicator progress) {
|
||||
// do not mess with real editor highlights
|
||||
}
|
||||
};
|
||||
pass.setFailFastOnAcquireReadAction(false);
|
||||
DaemonProgressIndicator progress = new DaemonProgressIndicator();
|
||||
|
||||
Reference in New Issue
Block a user