通过扫描文档可以找到:
{
"key": "f4",
"command": "workbench.action.tasks.runTask"
}
但它只会打开任务托盘并且可以选择任务。问题是如何运行特定任务?
{
"key": "f4",
"command": "workbench.action.tasks.runTask.customTask"
}
//Command not found
答案 0 :(得分:2)
记录在案here。您可以通过args
属性提供任务名称来完成此操作,例如:
{
"key": "f4",
"command": "workbench.action.tasks.runTask",
"args": "Run tests"
}