You can set the icon in the extension’s package.json
file, which is also called “extension manifest”.
The field in which you set the path to an icon is called "icon"
. The icon file itself has to be 128×128 pixels. As noted by Philipp Kief in the comments, you should use a PNG file, not an SVG.
Example:
{
"name": "extension-name",
"displayName": "Extension Name",
"description": "...",
"icon": "images/spellIcon.png",
"version": "0.0.1",
...
More on VS Code’s official page.