Can't step through 'Just my code' when

2020-06-23 06:53发布

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.

1条回答
SAY GOODBYE
2楼-- · 2020-06-23 07:49

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.

查看更多
登录 后发表回答