Skip to content
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

Merged
merged 1 commit into from
Sep 28, 2017

Conversation

chuckjaz
Copy link
Contributor

@chuckjaz chuckjaz commented Sep 26, 2017

PR Type

What kind of change does this PR introduce?

[x] Bugfix

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?

[ ] Yes
[x] No

@mary-poppins
Copy link

You can preview 9f0dc83 at https://pr19424-9f0dc83.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 3864833 at https://pr19424-3864833.ngbuilds.io/.

@chuckjaz chuckjaz added the target: major This PR is targeted for the next major release label Sep 28, 2017
@vicb vicb added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release and removed target: major This PR is targeted for the next major release labels Sep 28, 2017
@vicb vicb merged commit ff5b050 into angular:master Sep 28, 2017
@@ -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;
Copy link
Member

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.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants