'Using default VS Code icons on an extension
Solution 1:[1]
I don't think there's any way to reference built-in icons, so you would have to include copies of these in your extension. This is what the vscode-code-outline extension does (along with many others). There's a relevant feature request here:
[icons] Support to allow re-using VSCode icons in user extensions (#31466)
There's a nice overview of all built-in document symbol / suggest icons here. The .svg assets can be found here:
Solution 2:[2]
It is now possible to use codicons in a tree item:
getChildren() {
return [
{
collapsibleState: vscode.TreeItemCollapsibleState.None,
label: 'label',
// Replace 'circle-outline' with desired codicon: https://microsoft.github.io/vscode-codicons/dist/codicon.html
iconPath: new vscode.ThemeIcon('circle-outline'),
}
];
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gama11 |
| Solution 2 | Pelly Benassi |

