【问题标题】:Bind key to specific task [duplicate]将密钥绑定到特定任务[重复]
【发布时间】:2018-03-16 10:32:52
【问题描述】:

通过文档扫描可以找到:

{
    "key": "f4",
    "command": "workbench.action.tasks.runTask"
}

但它只打开任务托盘并提示选择任务。问题是如何运行特定任务?

{
    "key": "f4",
    "command": "workbench.action.tasks.runTask.customTask"
}
//Command not found

【问题讨论】:

    标签: visual-studio-code vscode-tasks


    【解决方案1】:

    这已记录在 here。您可以通过args 属性提供任务名称来执行此操作,例如:

    {
        "key": "f4",
        "command": "workbench.action.tasks.runTask",
        "args": "Run tests"
    }
    

    【讨论】:

    • 仅供参考,这必须是一个列表,[ { "key": "Alt+r", "command": "workbench.action.tasks.runTask", "args": "MyTask " }, ]⏎
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-29
    • 1970-01-01
    • 2017-09-20
    相关资源
    最近更新 更多