visual-studio-code - 如何在 VSCode 的 QuickOpen 面板中预过滤 showCommands

标签 visual-studio-code

我有一些扩展可以添加 4 个、6 个或更多命令,但我不想为每个扩展设置快捷方式。 理想情况下,我可以创建一个快捷方式来显示该扩展的所有命令。 或者,显示 workbench.action.showCommands 列表,其中已设置一些文本,以便仅显示有趣的命令。 像这样的事情:

{
    "key": "ctrl+[Backquote] z",
    "command": "workbench.action.showCommands",
    "args": { "text": "task marks" },
    "when": "editorTextFocus"
}

有什么想法可以做到这一点吗?我在 VSCode 的 API documentation 中找不到 workbench.action.showCommands .

最佳答案

尝试使用它(使用您选择的任何键绑定(bind)):

{
  "key": "alt+z",
  "command" : "workbench.action.quickOpen", 
   "args"   : ">task marks",
   "when"   : "editorTextFocus"
}

我从 issues: adding an argument to the quickOpen panel 获取了语法.

奇怪的是,这行不通:

"command": "workbench.action.showCommands", 
"args": "task marks",

只有 workbench.action.quickOpen 命令才会接受参数。

关于visual-studio-code - 如何在 VSCode 的 QuickOpen 面板中预过滤 showCommands,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54420051/

相关文章:

bash - 如何使用 VS Code 集成终端以编程方式运行命令

angular - Visual Studio Code 中损坏的自动导入

visual-studio-code - JSDoc @typedef 未在其他文件中使用

powershell - 如何快速更改 shell 文件夹以匹配当前打开的文件

json - 为什么 `latex-workshop` 扩展名忽略清理文件扩展名?

visual-studio-code - 如何在 VSCode 的 Markdown 预览中启用复选框

javascript - 是否可以阻止 prettier 在 Promise.try 之后为 .then() {} 语句添加额外的选项卡?

python - VS 代码 : "The isort server crashed 5 times in the last 3 minutes..."

visual-studio-code - 如何在 Visual Studio Code 中禁用 "fake"右括号注释?

visual-studio-code - vscode 开发容器是否应该运行 npm install 作为其设置的一部分?