mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Revert to previous behavior for tree data providers getChildren (#11308)
* Revert to previous behavior for tree data providers without resolve support * Add another sql carbon edit
This commit is contained in:
@@ -219,16 +219,23 @@ export class TreeViewDataProvider implements ITreeViewDataProvider {
|
|||||||
return this.itemsMap.size === 0;
|
return this.itemsMap.size === 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async postGetChildren(elements: ITreeItem[]): Promise<ResolvableTreeItem[]> { // {{SQL CARBON EDIT}} For use by Component Tree View
|
protected async postGetChildren(elements: ITreeItem[]): Promise<ITreeItem[]> { // {{SQL CARBON EDIT}} For use by Component Tree View
|
||||||
const result: ResolvableTreeItem[] = [];
|
const result: ITreeItem[] = []; //{{SQL CARBON EDIT}}
|
||||||
const hasResolve = await this.hasResolve;
|
const hasResolve = await this.hasResolve;
|
||||||
if (elements) {
|
if (elements) {
|
||||||
for (const element of elements) {
|
for (const element of elements) {
|
||||||
const resolvable = new ResolvableTreeItem(element, hasResolve ? () => {
|
// {{SQL CARBON EDIT}} We rely on custom properties on the tree items in a number of places so creating a new item here was
|
||||||
return this._proxy.$resolve(this.treeViewId, element.handle);
|
// {{SQL CARBON EDIT}} clearing those. Revert to old behavior if the provider doesn't support a resolve (our normal case)
|
||||||
} : undefined);
|
if (hasResolve) {
|
||||||
this.itemsMap.set(element.handle, resolvable);
|
const resolvable = new ResolvableTreeItem(element, hasResolve ? () => {
|
||||||
result.push(resolvable);
|
return this._proxy.$resolve(this.treeViewId, element.handle);
|
||||||
|
} : undefined);
|
||||||
|
this.itemsMap.set(element.handle, resolvable);
|
||||||
|
result.push(resolvable);
|
||||||
|
} else {
|
||||||
|
this.itemsMap.set(element.handle, element);
|
||||||
|
result.push(element);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user