未验证 提交 8d1b3b59 编写于 作者: A Alex Ross

Fix location of onDidChangeTreeData in proposal

Part of #32592
上级 6b87d7d7
......@@ -918,13 +918,19 @@ declare module 'vscode' {
//#endregion
//#region Custom Tree View Drag and Drop https://github.com/microsoft/vscode/issues/32592
export interface TreeViewOptions<T> {
/**
* A data provider that provides tree data
*/
export interface TreeDataProvider<T> {
/**
* An optional event to signal that elements or the root have changed.
* An optional event to signal that an element or root has changed.
* This will trigger the view to update the changed element/root and its children recursively (if shown).
* To signal that root has changed, do not pass any argument or pass `undefined` or `null`.
*/
onDidChangeTreeData?: Event<T | T[] | undefined | null | void>;
onDidChangeTreeData2?: Event<T | T[] | undefined | null | void>;
}
export interface TreeViewOptions<T> {
/**
* An optional interface to implement drag and drop in the tree view.
*/
......
......@@ -253,7 +253,9 @@ class ExtHostTreeView<T> extends Disposable {
}
this.dataProvider = options.treeDataProvider;
this.dndController = options.dragAndDropController;
if (this.dataProvider.onDidChangeTreeData) {
if (this.dataProvider.onDidChangeTreeData2) {
this._register(this.dataProvider.onDidChangeTreeData2(elementOrElements => this._onDidChangeData.fire({ message: false, element: elementOrElements })));
} else if (this.dataProvider.onDidChangeTreeData) {
this._register(this.dataProvider.onDidChangeTreeData(element => this._onDidChangeData.fire({ message: false, element })));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册