-
Notifications
You must be signed in to change notification settings - Fork 25.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(compiler): correctly map error message locations #19424
Conversation
9f0dc83
to
3864833
Compare
You can preview 9f0dc83 at https://pr19424-9f0dc83.ngbuilds.io/. |
You can preview 3864833 at https://pr19424-3864833.ngbuilds.io/. |
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we just use emittedLine.indent * _INDENT_WITH.length
, same as is done at L124? That would avoid building the indentation string.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When mapping diagnostics errors from the generated source for a template the mapping would sometimes produce the wrong source span.
What is the new behavior?
The mapping of diagnostic error messages produce the correct source span.
Does this PR introduce a breaking change?