Skip to content

Commit

Permalink
🐛 fix esql highlight for multiline
Browse files Browse the repository at this point in the history
  • Loading branch information
dej611 committed Dec 21, 2023
1 parent 87d5d6b commit fbc6558
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 fbc6558

Please sign in to comment.