Merge from vscode 2cd495805cf99b31b6926f08ff4348124b2cf73d

This commit is contained in:
ADS Merger
2020-06-30 04:40:21 +00:00
committed by AzureDataStudio
parent a8a7559229
commit 1388493cc1
602 changed files with 16375 additions and 12940 deletions

View File

@@ -56,6 +56,10 @@ function isCollapsibleStateUpdate(update: CollapseStateUpdate): update is Collap
return typeof (update as any).collapsible === 'boolean';
}
export interface IList<T> extends ISpliceable<T> {
updateElementHeight(index: number, height: number): void;
}
export class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = void> implements ITreeModel<T, TFilterData, number[]> {
readonly rootRef = [];
@@ -78,7 +82,7 @@ export class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = voi
constructor(
private user: string,
private list: ISpliceable<ITreeNode<T, TFilterData>>,
private list: IList<ITreeNode<T, TFilterData>>,
rootElement: T,
options: IIndexTreeModelOptions<T, TFilterData> = {}
) {
@@ -212,6 +216,15 @@ export class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = voi
}
}
updateElementHeight(location: number[], height: number): void {
if (location.length === 0) {
throw new TreeError(this.user, 'Invalid tree location');
}
const { listIndex } = this.getTreeNodeWithListIndex(location);
this.list.updateElementHeight(listIndex, height);
}
has(location: number[]): boolean {
return this.hasTreeNode(location);
}