我正在创建我的第二个vscode扩展,它是一个语言服务扩展(它有服务器端和客户端)
我需要知道如何使我的扩展有一个图标显示在ActivityBar和当点击,我需要显示一个非常基本的面板,只有两个标签和文本框输入(这是金属扩展的外观)
我查过这些文件,没有任何运气。
我也找到了这个答案,但是左边的ActivityBar add icon to activity bar in visual studio code extension没有显示这个图标。
这是来自packages.json的我的投稿部分,如果您需要任何其他信息,请允许我在注释中
"contributes": {
"configuration": {
"type": "object",
"title": "Example configuration",
"properties": {
"navCode.maxNumberOfProblems": {
"scope": "resource",
"type": "number",
"default": 100,
"description": "Controls the maximum number of problems produced by the server."
},
"navCode.trace.server": {
"scope": "window",
"type": "string",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "Traces the communication between VS Code and the language server."
}
}
},
"viewsContainers": {
"activitybar": [
{
"id": "package-explorer",
"title": "Package Explorer",
"icon": "media/my.svg"
}
]
},
"views": {
"package-explorer": [
{
"id": "package-dependencies",
"name": "Dependencies"
},
{
"id": "package-outline",
"name": "Outline"
}
]
}
},
发布于 2022-10-03 01:13:33
如果您已经在viewContainer
中声明了您的view
和packages.json
本身,但是您的扩展仍然没有显示在ActiviyBar中,原因可能是指向图标的路径是错误的,或者图像不存在。
我创建了一个带有nav-code-logo.png的图像文件夹,然后在packages.json中使用了该路径。
"icon": "images/nav-code-logo.png"
现在起作用了。
https://stackoverflow.com/questions/73929906
复制相似问题