Skip to content

Commit

Permalink
[ES|QL] Fix highlight for multiline #2 (elastic#173827)
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 authored Dec 21, 2023
1 parent f6b7df3 commit 41375d7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ export class ESQLTokensProvider implements monaco.languages.TokensProvider {
const tokenTypeName = lexer.vocabulary.getSymbolicName(token.type);

if (tokenTypeName) {
const myToken = new ESQLToken(tokenTypeName, token.startIndex, token.stopIndex);
const indexOffset = cleanedLine === line ? 0 : line.length - cleanedLine.length;
const myToken = new ESQLToken(
tokenTypeName,
token.startIndex + indexOffset,
token.stopIndex + indexOffset
);
myTokens.push(myToken);
}
}
Expand Down

0 comments on commit 41375d7

Please sign in to comment.