Visual Studio 代码:是否可以向 tasks.json 添加一个重新运行上一个任务的任务?
Visual Studio Code: Is it possible to add a task to tasks.json that reruns the previous task?
我想在我的 VS Code tasks.json 文件中添加一个任务,它可以重新运行 我 运行 的最后一个任务。
我知道有一个命令Rerun Last Task
,当我按F1
到Show All Commands
时我可以使用它。然而,并不是每个开发人员都知道输入 F1
来显示所有命令,但他们知道 F7
用于构建任务。这就是为什么我想在我们的基线中添加一些东西 tasks.json。
有没有办法以某种方式在 tasks.json 中调用 Rerun Last Task
命令?或者也许有一个变量有最后一个任务运行?
{
"label": "rerun last command",
"command": "${command:workbench.action.tasks.reRunTask}",
"type": "shell",
"problemMatcher": [],
},
该任务将重新运行上一个任务。你看你可以将任何命令变成一个变量,以便在 launch.json 或 tasks.json 中使用,格式为:
${command:some command ID here}
见https://code.visualstudio.com/docs/editor/variables-reference#_command-variables
这会创建一个“命令变量”,可以用作参数或命令。
我想在我的 VS Code tasks.json 文件中添加一个任务,它可以重新运行 我 运行 的最后一个任务。
我知道有一个命令Rerun Last Task
,当我按F1
到Show All Commands
时我可以使用它。然而,并不是每个开发人员都知道输入 F1
来显示所有命令,但他们知道 F7
用于构建任务。这就是为什么我想在我们的基线中添加一些东西 tasks.json。
有没有办法以某种方式在 tasks.json 中调用 Rerun Last Task
命令?或者也许有一个变量有最后一个任务运行?
{
"label": "rerun last command",
"command": "${command:workbench.action.tasks.reRunTask}",
"type": "shell",
"problemMatcher": [],
},
该任务将重新运行上一个任务。你看你可以将任何命令变成一个变量,以便在 launch.json 或 tasks.json 中使用,格式为:
${command:some command ID here}
见https://code.visualstudio.com/docs/editor/variables-reference#_command-variables
这会创建一个“命令变量”,可以用作参数或命令。