使用扩展菜单的内置图标 [英] Using Built in Icons for Extension menus
问题描述
我想将调试器工具栏中使用的播放"按钮图标重用于我从扩展程序添加的新菜单项.
I'd like to reuse the "play" button icon used in the debugger toolbar for a new menu item I'm adding from an extension.
有没有办法在package.json"中设置图标信息以使用 VSCode 中已有的现有 svg 还是我必须提供自己的扩展?
Is there a way to set up the icon information in "package.json" to use that existing svg already in VSCode or do I have to supply my own for extensions?
推荐答案
是的,您可以使用内置图标,它们称为 Codicons.
Yes you can use built-in icons, they are called Codicons.
以下是它们的列表:https://code.visualstudio.com/api/references/icons-in-标签
要在 package.json 中使用它们,您需要输入 "icon":"$(iconIdentifier)"
.
To use them in your package.json, you will put "icon": "$(iconIdentifier)"
.
请注意,它们不会像这样工作:
Notice they will not work like this:
"icon":
{
"light": "$(iconIdentifier)",
"dark": "$(iconIdentifier)"
}
这篇关于使用扩展菜单的内置图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!