cache only top level matches to prevent cache trashing

GitOrigin-RevId: e0b299598c67b6227ed2450f4a2703ed52ec776c
This commit is contained in:
Dennis Ushakov
2019-08-01 14:03:25 +03:00
committed by intellij-monorepo-bot
parent eb6a74910c
commit a1df355ccf
@@ -91,7 +91,7 @@ public final class SyntaxMatchUtils {
if (selectorWeigh.weigh <= 0) {
continue;
}
TextMateLexerState injectionState = matchFirst(injection.getSyntaxNodeDescriptor(), string, byteOffset, selectorWeigh.priority, currentScope);
TextMateLexerState injectionState = matchFirstUncached(injection.getSyntaxNodeDescriptor(), string, byteOffset, selectorWeigh.priority, currentScope);
resultState = moreImportantState(resultState, injectionState);
}
return resultState;
@@ -135,7 +135,7 @@ public final class SyntaxMatchUtils {
if (syntaxNodeDescriptor.getStringAttribute(Constants.StringKey.END) != null) {
return TextMateLexerState.notMatched(syntaxNodeDescriptor);
}
return matchFirst(syntaxNodeDescriptor, string, byteOffset, priority, currentScope);
return matchFirstUncached(syntaxNodeDescriptor, string, byteOffset, priority, currentScope);
}
public static List<CaptureMatchData> matchCaptures(@NotNull TIntObjectHashMap<CharSequence> captures, @NotNull MatchData matchData, @NotNull StringWithId string) {