Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't step through 'Just my code' when using VSCode?

Is there a option in VSCode when debugging like the 'Just my Code' option in Visual Studio?

I want to step through my own code, not all the internal node code like next_tick.js

I've tried adding

"skipFiles": [
            "node_modules/**/*.js"
        ]

to the debug configuration, but that's not working.

like image 936
Kickaha Avatar asked Nov 11 '17 16:11

Kickaha


1 Answers

The answer can be found at the Visual Studio Code site: https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_skipping-uninteresting-code-node-chrome

In short, you forgot to add ${workspaceFolder}:

  "skipFiles": [
    "${workspaceFolder}/node_modules/**/*.js",
    "${workspaceFolder}/lib/**/*.js"
  ]

However, as Mark noted, there is a magic string to cover all internal node modules and then the solution is:

  "skipFiles": [
     "<node_internals>/**/*.js"
  ]

added in the .vscode/launch.json file.

like image 183
Siderite Zackwehdex Avatar answered Oct 06 '22 12:10

Siderite Zackwehdex