W. *_*man 3 icons visual-studio-code vscode-extensions
我正在尝试向运行我的命令的“编辑器/标题”部分添加一个按钮。在我当前的配置中,通过单击 3 个按钮展开菜单时会显示我的命令名称。我想要的是显示一个运行我的命令的图标(如拆分编辑器按钮)。
从文档中我发现应该可以为图标提供 svg 文件,但我更喜欢使用产品图标中的图标。这样图标就可以随着主题而改变。
这是否可能,或者我只是配置错误?
这是我到目前为止的配置:
"contributes": {
"commands": [
{
"command": "my-extension.my-command"
"title": "My Command",
"icon": "preview" // <-- this refers to the icon from 'product icons'
}
],
"menus": {
"editor/title": [
{
"when": "resourceExtname == .xyz",
"command": "my-extension.my-command"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
Sha*_*les 10
这应该有效:
"contributes": {
"commands": [
{
"command": "my-extension.my-command"
"title": "My Command",
"icon": "$(preview)" // <-- the syntax for using a 'product icon' is $(iconIdentifier)
}
],
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1566 次 |
最近记录: |