mlops-club / vscode-clearml-session-manager

VS Code extension for create remote workstations (sessions) using ClearML.
Apache License 2.0
16 stars 3 forks source link

Buttons in sidebar #3

Closed phitoduck closed 10 months ago

phitoduck commented 10 months ago

Accomplishment 1 -- I found out how to use icons

image

image

It turns out, VS Code has a whole library of built-in icons that you can reference with a $(icon-name) format in package.json and with iconPath = new vscode.ThemeIcon("icon-name"). Here's the icon reference: https://code.visualstudio.com/api/references/icons-in-labels

Since we have these built-in icons, I deleted all the icon files from the Node Dependencies tutorial we followed.

Accomplishment 2 -- I found out how to make icons show up on the tree items

Also, I added a property called this.contextValue to the tree view items to use in the when: clause in package.json

image

I set this value so we could distinguish between top-level ClearmlSession tree items, and their children... which are just vanilla vscode.TreeItems. This way, only the top-level TreeItems get the play button, and the "detail TreeItems" nested underneath have a "Copy to Clipboard" button.