【问题标题】:VSCode launch.json's attribute 'skipFiles' not working as expectedVSCode launch.json 的属性“skipFiles”未按预期工作
【发布时间】:2021-04-06 05:28:13
【问题描述】:

Vscode 调试器没有跳过 node_internals。我不知道我在这里缺少什么。下面是我的launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
      
    "configurations": [

        {
            "type": "node",
            "request": "launch",
            "name": "Build and run Project",
            "program": "${workspaceFolder}/out/code/main.js",
            "preLaunchTask": "npm: build",
            "sourceMaps": true,
            "smartStep": true,
            "env": {"NODE_PATH": "${workspaceFolder}/out"},
            "skipFiles": [
                "${workspaceFolder}/node_modules/**/*.js",
                "<node_internals>/**/*.js",
                "/<node_internals>/**",
                "**/<node_internals>/**",
                "<node_internals>/internal/**",

            ],
            "cwd": "${workspaceFolder}",
            "outFiles": [
                "${workspaceFolder}/out/**/*.js"
            ]
        }


        
    ]
}

我尝试了所有可能的 glob 模式,但调试器没有跳过指定的路径。

节点和 npm 版本

v14.16.0 和 6.14.11

代码版本(linux)

1.55.0 c185983a683d14c396952dd432459097bc7f757f x64

感谢任何帮助。 :-)

【问题讨论】:

    标签: visual-studio-code vscode-debugger


    【解决方案1】:

    Windows 还是 Linux?我发现跳过文件语法取决于平台和 / (Linux)或 \ (Windows),每个都需要。另外我不相信您需要文件夹的根位置,例如/&lt;node_internals&gt;/

    当我经常在 Windows 和 Linux 之间移动时,我通过提供这两种形式取得了成功:

    "skipFiles": [
      "${workspaceFolder}/node_modules/**/*.js",
      "${workspaceFolder}\\node_modules\\**\\*.js",
      "<node_internals>/**/*.js",
      "<node_internals>\\**\\*.js",
    ]
    

    我确实希望有一个更简单的答案,但我还没有找到。

    【讨论】:

    • 其实是 linux(Ubuntu 20.04)。
    猜你喜欢
    • 1970-01-01
    • 2020-04-26
    • 2021-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-05
    • 2011-08-28
    • 1970-01-01
    相关资源
    最近更新 更多