首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在Visual Studio代码中的多根工作区中启动复合任务?

如何在Visual Studio代码中的多根工作区中启动复合任务?
EN

Stack Overflow用户
提问于 2019-03-01 06:26:22
回答 1查看 1.2K关注 0票数 1

我正在尝试在vscode中同时启动客户端和服务器。这两个单独的任务各自都可以很好地工作。但是,我无法在工作区配置中运行复合任务。

我的假设是,工作区配置中的任务应该出现在调试下拉启动菜单中,如documentation - https://code.visualstudio.com/docs/editor/multi-root-workspaces#_debugging所示

这只是vscode的一个bug,还是我的配置有问题?所有3个配置文件都在下面。

Client launch.json

}
  "version": "2.0.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Start Client",
      "program": "${workspaceFolder}/src/index.ts",
      "outFiles": ["${workspaceFolder}/dist/**/*.js"],
      "console": "integratedTerminal"
    }
  ]
}

服务器launch.json

}
  "version": "2.0.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Start Server",
      "program": "${workspaceFolder}/src/index.ts",
      "outFiles": ["${workspaceFolder}/dist/**/*.js"],
    }
  ]
}

工作区配置

{
  "folders": [
    {
      "path": "client"
    },
    {
      "path": "server"
    }
  ],
  "launch": {
    "compounds": [
      {
        "name": "Server & Client",
        "configurations": [
          "Start Client",
          "Start Server"
        ]
      }
    ]
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-03-01 06:55:42

经过几个小时的寻找才找到了答案。

"launch": {
    "configurations": [], // This line was needed
    "compounds": [
      {
        "name": "Server & Client",
        "configurations": [
          "Start Client",
          "Start Server"
        ]
      }
    ]
  }
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54935255

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档