olov / ng-annotate

Add, remove and rebuild AngularJS dependency injection annotations
MIT License
2.03k stars 150 forks source link

Sourcemaps missing mappings for closing brace #201

Closed tyson-benson closed 8 years ago

tyson-benson commented 9 years ago

Hi there,

Great work on the plugin so far, I found an issue using the sourcemaps, there is no mapping produced for the closing brace for control blocks and functions. For example, when debugging in Chrome i can put a breakpoint on the third line in the source mapped TypeScript before applying ng-annotate example below:

var foo = () => {
    doSomething();
} // <-- can put breakpoint here
if (condition) {
    foo();
} // <-- can put breakpoint here

But after using ng-annotate, the lines on which i can put breakpoints are limited to the top two in the examples above. Is there a possibility you can change the sourcemap generator to create the appropriate mappings to preserve support for this?

Let me know if you need more info, it is easy to reproduce. In chrome it is easier to spot, as the lines with a closing brace are grayed out and you cannot insert the breakpoints.

olov commented 9 years ago

Thanks for the bug report - this is hopefully easy to fix. @smrq would you be able to take a look at it?

olov commented 8 years ago

I'd merge a PR fixing this issue.

olov commented 8 years ago

https://github.com/olov/ng-annotate/issues/245