Skip to content
This repository was archived by the owner on Oct 2, 2021. It is now read-only.
This repository was archived by the owner on Oct 2, 2021. It is now read-only.

Support debugging "Just my code" #7

Closed

Description

@roblourens

From Marcel (@maxhor) on March 30, 2016 14:48

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

Activity

  1. roblourens commented on May 5, 2016

    @roblourens
    MemberAuthor

    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.

  2. roblourens commented on May 5, 2016

    @roblourens
    MemberAuthor

    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?

  3. roblourens commented on May 5, 2016

    @roblourens
    MemberAuthor

    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.

  4. roblourens commented on May 5, 2016

    @roblourens
    MemberAuthor

    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:

    {
    
    
                "name": "Launch index.html",
                "type": "chrome",
                "request": "launch",
                "file": "index.html",
                "runtimeArgs":["--allow-file-access-from-files"],
                "sourceMaps":true,
                "diagnosticLogging": true,
                // "outDir":null,
                // "address":"localhost",
                // "program":null,
                // "stopOnEntry":false,
                // "args":null,
                "cwd": "${workspaceRoot}",
                "runtimeExecutable":null
            },
    
  5. roblourens commented on May 5, 2016

    @roblourens
    MemberAuthor

    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)?

  6. roblourens commented on May 5, 2016

    @roblourens
    MemberAuthor

    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.

  7. roblourens commented on May 5, 2016

    @roblourens
    MemberAuthor

    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.

  8. aaaaahaaaaa commented on May 27, 2016

    @aaaaahaaaaa

    +1 for the blackbox feature

  9. justin-romano commented on Jun 9, 2016

    @justin-romano

    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.

  10. roblourens commented on Jun 9, 2016

    @roblourens
    MemberAuthor

    Definitely, that's how it works in F12.

  11. justin-romano commented on Jun 10, 2016

    @justin-romano

    Well im sure thats the intention but there has been an outstanding bug. Still breaks for me in a blackboxed file on thrown exceptions

  12. roblourens commented on Jun 10, 2016

    @roblourens
    MemberAuthor

    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.

  13. octref commented on Oct 24, 2016

    @octref

    Related: microsoft/vscode-node-debug#16

    Really hope this get implemented. It's quite annoying to step into winjs.raw.base.in or lodash or something.

  14. roblourens commented on Oct 24, 2016

    @roblourens
    MemberAuthor

    There is 'smartStep' which will step over code that isn't sourcemapped. But, many libraries do ship with sourcemaps.

  15. octref commented on Oct 25, 2016

    @octref

    Yea and webpack doesn't seem to have an option to turn off sourcemap only for libraries.

  16. roblourens commented on Dec 14, 2016

    @roblourens
    MemberAuthor

    Shipped!

  17. skolmer commented on Dec 14, 2016

    @skolmer

    roblourens Kenneth Auchenberg (@auchenberg) Thanks guys, you are doing a great job here 👍

  18. locked and limited conversation to collaborators on Mar 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions