fix(compiler): correctly map error message locations (#19424)

This commit is contained in:
Chuck Jazdzewski
2017-09-28 10:53:04 -07:00
committed by Victor Berchet
parent b3db3f80ba
commit ff5b050a92
2 changed files with 43 additions and 2 deletions

View File

@ -161,7 +161,7 @@ export class EmitterVisitorContext {
spanOf(line: number, column: number): ParseSourceSpan|null {
const emittedLine = this._lines[line - this._preambleLineCount];
if (emittedLine) {
let columnsLeft = column - emittedLine.indent;
let columnsLeft = column - _createIndent(emittedLine.indent).length;
for (let partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) {
const part = emittedLine.parts[partIndex];
if (part.length > columnsLeft) {