Using Built in Icons for Extension menus

橙三吉。 提交于 2021-02-08 05:36:15

问题


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.

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?


回答1:


Yes you can use built-in icons, they are called Codicons.

Here is a list of them: https://code.visualstudio.com/api/references/icons-in-labels

To use them in your package.json, you will put "icon": "$(iconIdentifier)".

Notice they will not work like this:

"icon":
{
    "light": "$(iconIdentifier)",
    "dark": "$(iconIdentifier)"
}


来源:https://stackoverflow.com/questions/42403009/using-built-in-icons-for-extension-menus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!