【发布时间】:2021-09-02 10:38:35
【问题描述】:
我可以在launch.json 中使用来自launch.json 的输入变量。
"configurations": [
{
...
"args": [${input:file_no}]
"preLanuchTask": "runPreTasks"
...
}
],
"inputs": [
{
"id": "file_no",
"type": "promptString"
}
]
现在,我想访问同一个变量,而无需在tasks.json 中再次输入。
{
"version": "2.0.0",
"tasks":[
{
"label": "runPreTasks",
"type": "shell",
"command": sh,
"args": [
"/path2script/scriptName.sh",
"${input:file_no}" // This does not work, without defining input again
]
}
]
}
有没有办法在 vscode 中将输入变量从launch.json 传递到tasks.json?
【问题讨论】:
标签: visual-studio-code vscode-tasks