GitOrigin-RevId: 448260a36aa6d58f2f4c970d3960a51d5859d84a
This commit is contained in:
Alexey Kudravtsev
2025-02-06 17:18:27 +00:00
committed by intellij-monorepo-bot
parent 66b4ff26dd
commit 720f8b51e2
3 changed files with 5 additions and 7 deletions
@@ -44,11 +44,9 @@ public final class AnnotatorRunner {
private final AnnotatorStatisticsCollector myAnnotatorStatisticsCollector = new AnnotatorStatisticsCollector();
private final List<HighlightInfo> results = Collections.synchronizedList(new ArrayList<>());
public AnnotatorRunner(@NotNull PsiFile psiFile,
boolean batchMode,
@NotNull AnnotationSession annotationSession) {
myProject = psiFile.getProject();
myPsiFile = psiFile;
public AnnotatorRunner(@NotNull AnnotationSession annotationSession, boolean batchMode) {
myProject = annotationSession.getFile().getProject();
myPsiFile = annotationSession.getFile();
myAnnotationSession = annotationSession;
myDumbService = DumbService.getInstance(myProject);
myBatchMode = batchMode;
@@ -250,7 +250,7 @@ public sealed class GeneralHighlightingPass extends ProgressableTextEditorHighli
AnnotationSession session = AnnotationSessionImpl.create(getFile());
setupAnnotationSession(session, myPriorityRange, myRestrictRange,
((HighlightingSessionImpl)getHighlightingSession()).getMinimumSeverity());
AnnotatorRunner annotatorRunner = myRunAnnotators ? new AnnotatorRunner(getFile(), false, session) : null;
AnnotatorRunner annotatorRunner = myRunAnnotators ? new AnnotatorRunner(session, false) : null;
if (annotatorRunner == null) {
runnable.run();
return true;
@@ -186,7 +186,7 @@ final class InjectedGeneralHighlightingPass extends ProgressableTextEditorHighli
GeneralHighlightingPass.setupAnnotationSession(session, myPriorityRange, myRestrictRange,
((HighlightingSessionImpl)getHighlightingSession()).getMinimumSeverity());
AnnotatorRunner annotatorRunner = myRunAnnotators ? new AnnotatorRunner(injectedPsi, false, session) : null;
AnnotatorRunner annotatorRunner = myRunAnnotators ? new AnnotatorRunner(session, false) : null;
Divider.divideInsideAndOutsideAllRoots(injectedPsi, injectedPsi.getTextRange(), injectedPsi.getTextRange(), GeneralHighlightingPass.SHOULD_HIGHLIGHT_FILTER, dividedElements -> {
List<? extends @NotNull PsiElement> inside = dividedElements.inside();
LongList insideRanges = dividedElements.insideRanges();