vscode `debug.startDebugging()`无法从`.code-workspace`文件中找到配置,

ki1q1bka  于 5个月前  发布在  Vscode
关注(0)|答案(8)|浏览(64)
  1. 将调试配置放入 .code-workspace 文件
  2. 在扩展代码中,尝试通过 name 属性启动调试:
await debug.startDebugging(workspace.workspaceFolders?.[0], label);
  1. 收到错误
    "launch.json" 中缺少 "Launch Debug" 配置。
    工作区只包含 1 个文件夹。
pdsfdshx

pdsfdshx1#

看起来这个不支持。API说* The named configurations are looked up in '.vscode/launch.json' found in the given folder.

knsnq2tg

knsnq2tg2#

Just bumping that I ran into this problem using Mocha Test Explorer and wanting to run debug configs in a code workspace for a polyglot VSCode Extension (The PowerShell extension. It would be a nice-to-have, or otherwise be able to reference in my .code-workspace launch configs from the local workspace folder for preTask and postTask stuff, because right now I have to duplicate all the launch and task config locally to the workspace which leads to duplicate entries in my debug.

tcbh2hod

tcbh2hod3#

Bumping this too. Notice that it logically affects readyServerAction variant using startDebugging action.
I think this lack of implementation is also related to #169375 .
The .code-workspace file example below should be handled :

{
  "folders": [
    {
      "name": "smartend",
      "path": "../smartend"
    },
    {
      "name": "runtime",
      "path": "../runtime"
    },
  ],
  "launch": {
    "version": "0.2.0",
    "configurations": [
      {
        "name": "Hardhat : Run EVM",
        "type": "node-terminal",
        "request": "launch",
        "command": "npx hardhat node --hostname 127.0.0.1",
        "cwd": "${workspaceFolder:smartend}",
        "serverReadyAction": {
            "pattern": "Started HTTP and WebSocket JSON-RPC server at",
            "action": "startDebugging",
            "name": "Run Database"
        },
      },
      {
        "name": "Run Database",
        "type": "node-terminal",
        "request": "launch",
        "cwd": "${workspaceFolder:runtime}",
        "command": "pnpm debugDb",
      },
    ],
  }
}
mwngjboj

mwngjboj4#

Bumping this too to get the error fixed

pdtvr36n

pdtvr36n5#

请修复这个问题,它真的很受限。

bt1cpqcv

bt1cpqcv6#

面对相同的问题!

相关问题