我正在尝试在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"
]
}
]
}
}
发布于 2019-03-01 06:55:42
经过几个小时的寻找才找到了答案。
"launch": {
"configurations": [], // This line was needed
"compounds": [
{
"name": "Server & Client",
"configurations": [
"Start Client",
"Start Server"
]
}
]
}
https://stackoverflow.com/questions/54935255
复制相似问题