Use an object type to represent Position
This commit is contained in:
@@ -500,11 +500,11 @@ class TemplateReader {
|
||||
);
|
||||
|
||||
let tr = token.range!;
|
||||
if (tr.start[0] === tr.end[0]) {
|
||||
if (tr.start.line === tr.end.line) {
|
||||
// If it's a single line expression, adjust the range to only cover the sub-expression
|
||||
tr = {
|
||||
start: [tr.start[0], tr.start[1] + startExpression],
|
||||
end: [tr.end[0], tr.start[1] + endExpression + 1]
|
||||
start: {line: tr.start.line, column: tr.start.column + startExpression},
|
||||
end: {line: tr.end.line, column: tr.start.column + endExpression + 1}
|
||||
};
|
||||
} else {
|
||||
// Adjust the range to only cover the expression for multi-line strings
|
||||
@@ -515,8 +515,8 @@ class TemplateReader {
|
||||
const adjustedEnd = endExpression - beginningOfLine + 1;
|
||||
|
||||
tr = {
|
||||
start: [tr.start[0] + adjustedStartLine, adjustedStart],
|
||||
end: [tr.start[0] + adjustedStartLine, adjustedEnd]
|
||||
start: {line: tr.start.line + adjustedStartLine, column: adjustedStart},
|
||||
end: {line: tr.start.line + adjustedStartLine, column: adjustedEnd}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user