mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
call allHighlightsForRangeAreProduced((0,3)) even in case of runVisitors() called for visible element with range (0,3) which generated some info, then runVisitors() called for the the file with range (0,3).
This commit is contained in:
@@ -64,7 +64,7 @@
|
||||
<expected>OK</expected>
|
||||
</test>
|
||||
<test verify="false">
|
||||
<pattern><![CDATA[<warning descr="Empty group">(|)</warning>\n]]></pattern>
|
||||
<pattern><![CDATA[<warning descr="Empty group">(|)</warning>]]></pattern>
|
||||
<expected>OK</expected>
|
||||
</test>
|
||||
<test verify="false">
|
||||
|
||||
+17
-13
@@ -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<TextRange> nestedRange = new Stack<>();
|
||||
Stack<List<HighlightInfo>> 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<HighlightInfo> 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<PsiElement> elements,
|
||||
@NotNull List<ProperTextRange> ranges,
|
||||
int chunkSize,
|
||||
@NotNull ProgressIndicator progress,
|
||||
@NotNull Set<PsiElement> skipParentsSet,
|
||||
@NotNull HighlightInfoHolder holder,
|
||||
@NotNull List<HighlightInfo> insideResult,
|
||||
@NotNull List<HighlightInfo> outsideResult,
|
||||
boolean forceHighlightParents,
|
||||
@NotNull HighlightVisitor[] visitors) {
|
||||
Stack<TextRange> nestedRange = new Stack<>();
|
||||
Stack<List<HighlightInfo>> nestedInfos = new Stack<>();
|
||||
@NotNull List<ProperTextRange> ranges,
|
||||
int chunkSize,
|
||||
@NotNull ProgressIndicator progress,
|
||||
@NotNull Set<PsiElement> skipParentsSet,
|
||||
@NotNull HighlightInfoHolder holder,
|
||||
@NotNull List<HighlightInfo> insideResult,
|
||||
@NotNull List<HighlightInfo> outsideResult,
|
||||
boolean forceHighlightParents,
|
||||
@NotNull HighlightVisitor[] visitors,
|
||||
@NotNull Stack<TextRange> nestedRange,
|
||||
@NotNull Stack<List<HighlightInfo>> nestedInfos) {
|
||||
boolean failed = false;
|
||||
int nextLimit = chunkSize;
|
||||
for (int i = 0; i < elements.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user