diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 3733eb30b88b6..c3397ffc99fe2 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -5870,6 +5870,21 @@ declare module 'vscode' { */ export interface TreeView extends Disposable { + /** + * Event that is fired when an element is expanded + */ + readonly onDidExpandElement: Event; + + /** + * Event that is fired when an element is collapsed + */ + readonly onDidCollapseElement: Event; + + /** + * Currently selected elements. + */ + readonly selection: ReadonlyArray; + /** * Reveal an element. By default revealed element is selected. * diff --git a/src/vs/workbench/api/node/extHostTreeViews.ts b/src/vs/workbench/api/node/extHostTreeViews.ts index 44e7d43d4a637..b466dcbeb0824 100644 --- a/src/vs/workbench/api/node/extHostTreeViews.ts +++ b/src/vs/workbench/api/node/extHostTreeViews.ts @@ -49,6 +49,9 @@ export class ExtHostTreeViews implements ExtHostTreeViewsShape { } const treeView = this.createExtHostTreeViewer(viewId, options.treeDataProvider); return { + get onDidCollapseElement() { return treeView.onDidCollapseElement; }, + get onDidExpandElement() { return treeView.onDidExpandElement; }, + get selection() { return treeView.selectedElements; }, reveal: (element: T, options?: { select?: boolean }): Thenable => { return treeView.reveal(element, options); },