Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

report errors in the original line #420

Closed
DartBot opened this issue Jun 5, 2015 · 2 comments
Closed

report errors in the original line #420

DartBot opened this issue Jun 5, 2015 · 2 comments

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="96" height="96"hspace="10"> Issue by sigmundch
Originally opened as dart-lang/sdk#20126


We have situations where we report errors in a line that is transformed, so users can't see where the error really comes from. For example:

> [Warning bwu_fontawesome_iconset_svg|example/index.html]: line 1537, column 1: private symbols cannot be used in event handlers

This error is detected in script compactor after all the inlining is done, so we end up reporting an error in line 1537 for a file with just 66 lines.

Probably the easiest solution is to move some of the checks for private symbols into the linter, which is processing files before any transformation happens.

To avoid parsing all the template expressions twice, we could pass the extracted data as an asset to the later phase.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch


Removed Priority-Unassigned label.
Added Priority-Medium label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch


This is closer to be working, we still do inlining before we do some portions of the linting. However, Jake did a large refactoring that will make it easier to compose one transformer after another. We should be able to pass the HTML document from one transformer to the next, instead of reparsing the HTML. That way the original source-spans will be preserved, and error messages will contain the correct location.


cc @jakemac53.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants