Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code 如何使VS代码复合调试器在默认情况下运行?_Visual Studio Code_Vscode Settings_Vscode Debugger - Fatal编程技术网

Visual studio code 如何使VS代码复合调试器在默认情况下运行?

Visual studio code 如何使VS代码复合调试器在默认情况下运行?,visual-studio-code,vscode-settings,vscode-debugger,Visual Studio Code,Vscode Settings,Vscode Debugger,我有以下.vscode/launch.json配置: { "version": "0.2.0", "configurations": [ { "type": "chrome", "request": "launch", "name": "Next: Chrome", "url": "localhost:3000", "webRoot": "${workspaceFolder}/src" }, {

我有以下
.vscode/launch.json
配置:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Next: Chrome",
      "url": "localhost:3000",
      "webRoot": "${workspaceFolder}/src"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "Next: Node",
      "runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next",
      "port": 9229,
      "env": {
        "NODE_OPTIONS": "--inspect"
      }
    }
  ],
  "compounds": [
    {
      "name": "Next: Full",
      "configurations": ["Next: Node", "Next: Chrome"]
    }
  ]
}
通过使用F5启动调试器,我希望它运行
Next:Full
命令。但是它运行的是
Next:Chrome
,因此看起来好像有些东西不工作,但您必须手动更改它,然后重新运行:


那就行了。但是可以在配置中将其设置为默认值吗?

可以通过在列表的第一个
配置中添加其他有用的条目,使用相同的名称(类型和请求也是必需的):

它被证明是一个别名:


可以在列表的第一个
配置中添加其他有用的条目,并使用相同的名称(类型和请求也是必需的):

它被证明是一个别名:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "name": "Next: Full",
      "request": "launch"
    },
    {
      "type": "chrome",
      "request": "launch",
      "name": "Next: Chrome",
      "url": "localhost:3000",
      "webRoot": "${workspaceFolder}/src"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "Next: Node",
      "runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next",
      "port": 9229,
      "env": {
        "NODE_OPTIONS": "--inspect"
      }
    }
  ],
  "compounds": [
    {
      "name": "Next: Full",
      "configurations": ["Next: Node", "Next: Chrome"]
    }
  ]
}