mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not throw PCE from wolf because it could confuse daemon (IJPL-195114 Flaky: Highlighting is getting cancelled in a reopened file)
GitOrigin-RevId: 16c7424595dca5f359bf53417393816ddd375b2a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b94c230e61
commit
ea127fd1e1
+5
-4
@@ -3,8 +3,8 @@ package com.intellij.codeInsight.daemon.impl;
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.analysis.HighlightInfoHolder;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.diagnostic.ControlFlowException;
|
||||
import com.intellij.openapi.editor.Document;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.util.ProperTextRange;
|
||||
import com.intellij.psi.PsiFile;
|
||||
@@ -31,6 +31,8 @@ final class NasueousGeneralHighlightingPass extends GeneralHighlightingPass {
|
||||
myError = error;
|
||||
}
|
||||
|
||||
private static class StopAnalysisException extends RuntimeException implements ControlFlowException {
|
||||
}
|
||||
@Override
|
||||
protected @NotNull HighlightInfoHolder createInfoHolder(@NotNull PsiFile psiFile) {
|
||||
return new HighlightInfoHolder(psiFile) {
|
||||
@@ -38,7 +40,7 @@ final class NasueousGeneralHighlightingPass extends GeneralHighlightingPass {
|
||||
public boolean add(@Nullable HighlightInfo info) {
|
||||
if (info != null && info.getSeverity() == HighlightSeverity.ERROR) {
|
||||
myError.set(info);
|
||||
throw new ProcessCanceledException();
|
||||
throw new StopAnalysisException();
|
||||
}
|
||||
return super.add(info);
|
||||
}
|
||||
@@ -50,8 +52,7 @@ final class NasueousGeneralHighlightingPass extends GeneralHighlightingPass {
|
||||
try {
|
||||
super.collectInformationWithProgress(progress);
|
||||
}
|
||||
catch (Exception ignored) {
|
||||
// could throw PCE now
|
||||
catch (StopAnalysisException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user