mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 17:23:10 -05:00
Modify treeDataChange event to support firing arrays.
This commit is contained in:
9
src/vs/vscode.proposed.d.ts
vendored
9
src/vs/vscode.proposed.d.ts
vendored
@@ -954,6 +954,15 @@ declare module 'vscode' {
|
||||
|
||||
//#region Custom Tree View Drag and Drop https://github.com/microsoft/vscode/issues/32592
|
||||
export interface TreeViewOptions<T> {
|
||||
/**
|
||||
* An optional event to signal that elements or the root have 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>;
|
||||
/**
|
||||
* An optional interface to implement drag and drop in the tree view.
|
||||
*/
|
||||
dragAndDropController?: DragAndDropController<T>;
|
||||
}
|
||||
|
||||
|
||||
@@ -205,7 +205,7 @@ export class ExtHostTreeViews implements ExtHostTreeViewsShape {
|
||||
}
|
||||
|
||||
export type Root = null | undefined | void; // {{SQL CARBON EDIT}} export interface
|
||||
type TreeData<T> = { message: boolean, element: T | Root | false };
|
||||
type TreeData<T> = { message: boolean, element: T | T[] | Root | false };
|
||||
|
||||
export interface TreeNode extends IDisposable { // {{SQL CARBON EDIT}} export interface
|
||||
item: ITreeItem;
|
||||
@@ -292,7 +292,11 @@ export class ExtHostTreeView<T> extends Disposable {
|
||||
refreshingPromise = new Promise(c => promiseCallback = c);
|
||||
this.refreshPromise = this.refreshPromise.then(() => refreshingPromise!);
|
||||
}
|
||||
result.elements.push(current.element);
|
||||
if (Array.isArray(current.element)) {
|
||||
result.elements.push(...current.element);
|
||||
} else {
|
||||
result.elements.push(current.element);
|
||||
}
|
||||
}
|
||||
if (current.message) {
|
||||
result.message = true;
|
||||
|
||||
Reference in New Issue
Block a user