mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
lex file to the end for isMinified check to not start from the middle of string literal
fixes JSIndexTest.testMinifiedFile2(right-slider.m.js)
This commit is contained in:
@@ -80,7 +80,12 @@ public class MinifiedFilesUtil {
|
||||
if (startOffset <= 0) {
|
||||
return true;
|
||||
}
|
||||
lexer.start(fileContent, startOffset, fileContent.length());
|
||||
|
||||
while (lexer.getTokenType() != null && lexer.getTokenStart() < startOffset) lexer.advance();
|
||||
if (lexer.getTokenType() == null || (fileContent.length() - lexer.getTokenStart() < MIN_SIZE * 2)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return isMinified(lexer, parserDefinition, noWSRequireBeforeTokenSet, noWSRequireAfterTokenSet, stringsTokenSet);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user