You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 2, 2021. It is now read-only.
When setting a breakpoint in typescript and then stepping through code, (either step over, step into, step out): I will end up in the javascript code that was generated from the typescript or in the code from libraries under node_modules (like Angularjs).
How can I change the settings so that when debugging my code, everything besides the typescript that I wrote myself is stepped over?
Copied from original issue: Microsoft/vscode-chrome-debug#137
If I set a breakpoint in my .ts code, I am complete lost after 2 or 3 steps. Not only will I hit the js file that goes with the ts file (I could maybe cope with that) But in a few steps I am in the middle of system.src.js, angular2.dev.js or angular2.polyfills.js.
I'd say there's more people then just me that will be lost when they end up in angular2.polyfills.js.
Do you end up stepping into the JS file for TS that you wrote? If you're using something like webpack then there are some cases where the end result JS has script that isn't mapped to any TS. But if you're on a line that should have TS associated with it, then can you post the diagnostic log from the stepping?
If you're stepping into files that aren't yours, then at the moment you just need to use a combination of breakpoints and stepping to not debug the stuff you don't care about.
Is it likely that 'just my code' will be implemented not too far in the future ?
Regarding TS / JS :
I don't use webpack. Javascript lines should have TS associated, so I attach the log ( am I right that I can only copy what is visible from the console ?)
Probably not in the really near future, got other stuff to do first. Thanks for the annotated log. Yeah, at the moment you can only copy the visible portion of the log. I'm not sure what's going on there. It looks like you step through lines 39, 40, and 41 (0-indexed) of the js file, then at line 41, it returns the js file in the stackTrace instead of the ts file. That would most likely happen because it can't resolve the sourcemap for that particular location. Can you share the project with me? Or just that file and its sourcemap (.js, .ts, and .js.map)?
I share. I am not used to publish here, normally I am on Bitbucket. As you do not seem to have an account on bitbucket, I publish my project on github. Hope I did it right. Its called 'plunk'. (its just the sample project from Angular.io)
Project is not in exact same state as when I retrieved the log, Sorry for that. I watch that in future. But still, after some debuggung steps, debugging ends in .js.
Thanks. Looks like the exact lines you were debugging aren't the same now, so I can't tell you whether that was right or not. I always step into JS eventually but it's either because it's an angular file, or a line that doesn't have a mapping in TS. Like sometimes I step into the decorators. So there's not much you can do about that.
I should point out it would be nice if one could turn an break on "All Exception" but the same time blackbox those scripts that one does not care about like jQuery rather than just a blanket "just my code" feature. Would be more flexible.
Activity
roblourens commentedon May 5, 2016
You're describing a feature called "Just My Code" in F12 or "blackbox scripts" in Chrome Devtools. We could probably implement that but haven't yet.
roblourens commentedon May 5, 2016
From Marcel (@maxhor) on March 30, 2016 18:47
ok,
But I think I am missing something.
If I set a breakpoint in my .ts code, I am complete lost after 2 or 3 steps. Not only will I hit the js file that goes with the ts file (I could maybe cope with that) But in a few steps I am in the middle of system.src.js, angular2.dev.js or angular2.polyfills.js.
I'd say there's more people then just me that will be lost when they end up in angular2.polyfills.js.
So what does one do to make debugging workable?
roblourens commentedon May 5, 2016
Do you end up stepping into the JS file for TS that you wrote? If you're using something like webpack then there are some cases where the end result JS has script that isn't mapped to any TS. But if you're on a line that should have TS associated with it, then can you post the diagnostic log from the stepping?
If you're stepping into files that aren't yours, then at the moment you just need to use a combination of breakpoints and stepping to not debug the stuff you don't care about.
roblourens commentedon May 5, 2016
From Marcel (@maxhor) on March 31, 2016 6:7
Is it likely that 'just my code' will be implemented not too far in the future ?
Regarding TS / JS :
I don't use webpack. Javascript lines should have TS associated, so I attach the log ( am I right that I can only copy what is visible from the console ?)
log.txt
I ' launched' the debugger, here is associated launch.json:
roblourens commentedon May 5, 2016
Probably not in the really near future, got other stuff to do first. Thanks for the annotated log. Yeah, at the moment you can only copy the visible portion of the log. I'm not sure what's going on there. It looks like you step through lines 39, 40, and 41 (0-indexed) of the js file, then at line 41, it returns the js file in the stackTrace instead of the ts file. That would most likely happen because it can't resolve the sourcemap for that particular location. Can you share the project with me? Or just that file and its sourcemap (.js, .ts, and .js.map)?
roblourens commentedon May 5, 2016
From Marcel (@maxhor) on April 4, 2016 8:44
I share. I am not used to publish here, normally I am on Bitbucket. As you do not seem to have an account on bitbucket, I publish my project on github. Hope I did it right. Its called 'plunk'. (its just the sample project from Angular.io)
Project is not in exact same state as when I retrieved the log, Sorry for that. I watch that in future. But still, after some debuggung steps, debugging ends in .js.
roblourens commentedon May 5, 2016
Thanks. Looks like the exact lines you were debugging aren't the same now, so I can't tell you whether that was right or not. I always step into JS eventually but it's either because it's an angular file, or a line that doesn't have a mapping in TS. Like sometimes I step into the decorators. So there's not much you can do about that.
aaaaahaaaaa commentedon May 27, 2016
+1 for the blackbox feature
justin-romano commentedon Jun 9, 2016
I should point out it would be nice if one could turn an break on "All Exception" but the same time blackbox those scripts that one does not care about like jQuery rather than just a blanket "just my code" feature. Would be more flexible.
roblourens commentedon Jun 9, 2016
Definitely, that's how it works in F12.
justin-romano commentedon Jun 10, 2016
Well im sure thats the intention but there has been an outstanding bug. Still breaks for me in a blackboxed file on thrown exceptions
roblourens commentedon Jun 10, 2016
To be clear, it's not implemented in this extension. So, yeah. Just saying that's how we did it in the F12 browser tools in Edge.
octref commentedon Oct 24, 2016
Related: microsoft/vscode-node-debug#16
Really hope this get implemented. It's quite annoying to step into
winjs.raw.base.inor lodash or something.roblourens commentedon Oct 24, 2016
There is 'smartStep' which will step over code that isn't sourcemapped. But, many libraries do ship with sourcemaps.
octref commentedon Oct 25, 2016
Yea and webpack doesn't seem to have an option to turn off sourcemap only for libraries.
roblourens commentedon Dec 14, 2016
Shipped!
auchenberg commentedon Dec 14, 2016
Tweeted! https://mobile.twitter.com/auchenberg/status/809170122908827649
Blogged! http://code.visualstudio.com/updates
skolmer commentedon Dec 14, 2016
roblourens Kenneth Auchenberg (@auchenberg) Thanks guys, you are doing a great job here 👍