diff --git a/RegExpSupport/testData/RETest.xml b/RegExpSupport/testData/RETest.xml index 8069ee6fd0f8..2a448627e858 100644 --- a/RegExpSupport/testData/RETest.xml +++ b/RegExpSupport/testData/RETest.xml @@ -64,7 +64,7 @@ OK - (|)\n]]> + (|)]]> OK diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java index 88bd2c079394..8e2ae3d6e5ac 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java @@ -295,12 +295,16 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP final int chunkSize = Math.max(1, (elements1.size()+elements2.size()) / 100); // one percent precision is enough boolean success = analyzeByVisitors(visitors, holder, 0, () -> { - runVisitors(elements1, ranges1, chunkSize, progress, skipParentsSet, holder, insideResult, outsideResult, forceHighlightParents, visitors); + Stack nestedRange = new Stack<>(); + Stack> nestedInfos = new Stack<>(); + runVisitors(elements1, ranges1, chunkSize, progress, skipParentsSet, holder, insideResult, outsideResult, forceHighlightParents, visitors, + nestedRange, nestedInfos); final TextRange priorityIntersection = myPriorityRange.intersection(myRestrictRange); if ((!elements1.isEmpty() || !insideResult.isEmpty()) && priorityIntersection != null) { // do not apply when there were no elements to highlight myHighlightInfoProcessor.highlightsInsideVisiblePartAreProduced(myHighlightingSession, insideResult, myPriorityRange, myRestrictRange, getId()); } - runVisitors(elements2, ranges2, chunkSize, progress, skipParentsSet, holder, insideResult, outsideResult, forceHighlightParents, visitors); + runVisitors(elements2, ranges2, chunkSize, progress, skipParentsSet, holder, insideResult, outsideResult, forceHighlightParents, visitors, + nestedRange, nestedInfos); }); List postInfos = new ArrayList<>(holder.size()); // there can be extra highlights generated in PostHighlightVisitor @@ -330,17 +334,17 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP } private void runVisitors(@NotNull List elements, - @NotNull List ranges, - int chunkSize, - @NotNull ProgressIndicator progress, - @NotNull Set skipParentsSet, - @NotNull HighlightInfoHolder holder, - @NotNull List insideResult, - @NotNull List outsideResult, - boolean forceHighlightParents, - @NotNull HighlightVisitor[] visitors) { - Stack nestedRange = new Stack<>(); - Stack> nestedInfos = new Stack<>(); + @NotNull List ranges, + int chunkSize, + @NotNull ProgressIndicator progress, + @NotNull Set skipParentsSet, + @NotNull HighlightInfoHolder holder, + @NotNull List insideResult, + @NotNull List outsideResult, + boolean forceHighlightParents, + @NotNull HighlightVisitor[] visitors, + @NotNull Stack nestedRange, + @NotNull Stack> nestedInfos) { boolean failed = false; int nextLimit = chunkSize; for (int i = 0; i < elements.size(); i++) {