I am new to VSC extension development.
I started with the extension hello world and I want to add an icon to the activity bar and get a notification when it is clicked.
I add these lines to package.json
"viewsContainers": {
"activitybar": [
{
"id": "package-explorer",
"title": "Package Explorer",
"icon": "media/my.svg"
}
]
},
I copied these lines from VSC sample treeView (https://github.com/microsoft/vscode-extension-samples/tree/main/tree-view-sample)
The icon is also copied from the same repository.
When I run the extension, I am not getting any icon in the activity bar. What should I do so this icon appears in the activity bar and how can I be notified if it is clicked?
You must also specify a "views" item that matches the id of your viewContainer
Try adding the following right after the "viewsContainers" object in the "contributes" section of package.json
"views": {
"package-explorer": [
{
"id": "VIEW_ID",
"name": "VIEW_NAME"
}
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With