From a1df355ccf9bfe3a801e7fbc5f60dcc162297c62 Mon Sep 17 00:00:00 2001 From: Dennis Ushakov Date: Thu, 1 Aug 2019 13:07:52 +0300 Subject: [PATCH] cache only top level matches to prevent cache trashing GitOrigin-RevId: e0b299598c67b6227ed2450f4a2703ed52ec776c --- .../textmate/language/syntax/lexer/SyntaxMatchUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/textmate/src/org/jetbrains/plugins/textmate/language/syntax/lexer/SyntaxMatchUtils.java b/plugins/textmate/src/org/jetbrains/plugins/textmate/language/syntax/lexer/SyntaxMatchUtils.java index 5194cc48f807..d457021bd790 100644 --- a/plugins/textmate/src/org/jetbrains/plugins/textmate/language/syntax/lexer/SyntaxMatchUtils.java +++ b/plugins/textmate/src/org/jetbrains/plugins/textmate/language/syntax/lexer/SyntaxMatchUtils.java @@ -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 matchCaptures(@NotNull TIntObjectHashMap captures, @NotNull MatchData matchData, @NotNull StringWithId string) {