首页 > 解决方案 > 如何通过命令界面运行 AAA 命令?

问题描述

例如,我将使用asciidoc 扩展名将文档导出到 htiml 的命令。

终端里可以写什么命令通过vscode来运行?

或者您可以为命令创建一个任务,我通常通过命令托盘 ( Ctrl+Shift+P) 运行该任务?

在此处输入图像描述

ps 我对如何模拟命令不感兴趣。我想用 vscode 工具来执行它。

标签: visual-studio-codevscode-tasks

解决方案


此任务(在 tasks.json 中)将运行该命令:

  "tasks": [

    {
      "label": "asciiDoc to html",                 // whatever name you wish
           // find the command name from the extension or from Keyboard Shortcuts
      "command": "${command:asciidoc.saveHTML}",   
      "type": "shell",
      "problemMatcher": []
    }
  }

使用要转换为当前编辑器的 asciiDoc 文件运行任务。如果您愿意,可以将该任务分配给快捷方式(在 keybindings.json 中):

  {
    "key": "alt+r",                               // whatever keybinding you want
    "command": "workbench.action.tasks.runTask",
    "args": "asciiDoc to html"                    // same name here as in your task
  }

推荐阅读