English | 简体中文
This library is designed to quickly use the tree data provider in the vscode plugin using sidebar trees to make it easier to use
npm i @vscode-use/treeprovider
import { renderTree } from '@vscode-use/treeprovider'
export function activate(context: vscode.ExtensionContext) {
const { dispose, update } = renderTree(treeData, 'example1.id')
vscode.commands.registerCommand('refresh-tree', () => { // Update the tree
update([
{
label: 'label-2',
collapsed: true,
children: [
{
label: 'label-2-1',
command: {
title: 'label-2-1',
command: 'command-2',
arguments: ['2-1']
}
}
]
},
{
label: 'label-3',
children: [
{
label: 'label-3-1',
command: {
title: 'label-3-1',
command: 'command-3',
arguments: ['3-1']
}
}
]
}
])
})
}