I have written a very simple TreeView Extension for Visual Studio Code that displays a basic list of VSCode Tasks and executes the task on selection.
I would like the treeview to auto update when new tasks are added (via the tasks.json file, or autodetected tasks from things like the package.json files scripts) but can't figure out how to do so.
In my activate method I register my TreeDataProvider and execution command:
vscode.window.registerTreeDataProvider('vscodeTasks', treeProvider);
let disposable = vscode.commands.registerCommand('task.runTask', task => {
vscode.tasks.executeTask(task);
});
vscode.context.subscriptions.push(disposable);
And in my implementation of the TreeDataProvider in the getChildren function I fetch the tasks using:
vscode.tasks.fetchTasks()
And turn each into a TreeItem
Any help with the auto refresh would be appreciated.