I add a tree view to sidebar in my VSCode extension. And I found if I click the sidebar icon, the getChildren function will be called. Is there any api to make the "click" in my extension code rather than user mouse click? picture of sidebar icon in extension. Because there is a business scenario that needs to implement some automated operations that do not require user operations. Thank you!
I read the tree view document, but I can't find an interface that can implement this function:(
CodePudding user response:
Try this
vscode.commands.executeCommand("workbench.view.extension.<yourViewContainerNameHere")
Every contributed view automatically gets such a command created. In your case use your View Container ID.