跳到正文
Skillpedia
部署与云(DevOps)40k · #7472

vscode-ext-commands

它能做什么

这个工具可以帮你在 VS Code 扩展中添加或更新命令,并确保命令符合 VS Code 的规范和最佳实践。

适用场景

  • ✓为你的 VS Code 扩展添加新命令时。
  • ✓更新扩展中已有的命令时。
  • ✓确保命令遵循 VS Code 的约定时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/vscode-ext-commands/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/vscode-ext-commands/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我该如何按照最佳实践,为我的 VS Code 扩展添加一个新命令?”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会检查命令是否有标题、是否遵循命名规范,以及是否能正确显示。它还能帮你整理命令,使其在命令面板或 VS Code 侧边栏中呈现得更合理。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

VS Code extension command contribution

This skill helps you to contribute commands in VS Code extensions

When to use this skill

Use this skill when you need to:

  • Add or update commands to your VS Code extension

Instructions

VS Code commands must always define a title, independent of its category, visibility or location. We use a few patterns for each "kind" of command, with some characteristics, described below:

  • Regular commands: By default, all commands should be accessible in the Command Palette, must define a category, and don't need an icon, unless the command will be used in the Side Bar.

  • Side Bar commands: Its name follows a special pattern, starting with underscore (_) and suffixed with #sideBar, like _extensionId.someCommand#sideBar for instance. Must define an icon, and may or may not have some rule for enablement. Side Bar exclusive commands should not be visible in the Command Palette. Contributing it to the view/title or view/item/context, we must inform order/position that it will be displayed, and we can use terms "relative to other command/button" in order to you identify the correct group to be used. Also, it's a good practice to define the condition (when) for the new command is visible.

常见问题

VS Code 中的“命令”是什么?

命令是你可以在 VS Code 中执行的操作,例如打开文件、格式化代码,或运行扩展中的某个特定函数。

什么是“命令面板”(Command Palette)?

它是 VS Code 中的一个搜索框,你可以在里面输入内容,快速找到并执行命令。

“侧边栏命令”是什么?

这些命令会出现在 VS Code 侧边栏的特定位置,例如按钮或菜单,而不会出现在通用的命令面板中。

详情

作者的原始描述

Guidelines for contributing commands in VS Code extensions. Indicates naming convention, visibility, localization and other relevant attributes, following VS Code extension development guidelines, libraries and good practices

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7472
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能