【发布时间】:2018-11-08 11:32:21
【问题描述】:
有没有办法添加可以在我的launch.json 设置中使用的自定义变量,以便在 VSCode 中进行调试?目前,我发现的唯一方法是将它们添加到我的工作区设置中并参考来自${config}predefined variable。
我想在launch.json 中定义变量/属性并使用它们。如果我想将 myCustomVar 添加到我的所有 URL,下面是一个示例:
{
"version": "0.2.0",
"myCustomVar": "my_value",
"configurations": [
{
"name": "Page 1",
"type": "chrome",
"request": "launch",
"url": "http://localhost/page1.html?customVar=${myCustomVar}",
"sourceMaps": true,
"webRoot": "${workspaceFolder}/dev"
},
{
"name": "Page 2",
"type": "chrome",
"request": "launch",
"url": "http://localhost/page2.html?customVar=${myCustomVar}",
"sourceMaps": true,
"webRoot": "${workspaceFolder}/dev"
}
}
【问题讨论】:
标签: visual-studio-code vscode-settings