fixed the bug with collapsibleState (#2189)

This commit is contained in:
Leila Lali
2018-08-08 12:27:55 -07:00
committed by GitHub
parent 39bfd69dc9
commit 48d5cc554c
3 changed files with 12 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ class Root implements ITreeComponentItem {
label = 'root';
handle = '0';
parentHandle = null;
collapsibleState = 0;
collapsibleState = 2;
children = void 0;
options = undefined;
}

View File

@@ -8,6 +8,7 @@
import { ITree, IDataSource } from 'vs/base/parts/tree/browser/tree';
import { TPromise } from 'vs/base/common/winjs.base';
import { IModelViewTreeViewDataProvider, ITreeComponentItem } from 'sql/workbench/common/views';
import { TreeItemCollapsibleState } from 'vs/workbench/common/views';
/**
* Implements the DataSource(that returns a parent/children of an element) for the recent connection tree
@@ -34,7 +35,7 @@ export class TreeComponentDataSource implements IDataSource {
* Returns a boolean value indicating whether the element has children.
*/
public hasChildren(tree: ITree, node: ITreeComponentItem): boolean {
return this._dataProvider !== undefined;
return this._dataProvider !== undefined && node.collapsibleState !== TreeItemCollapsibleState.None;
}
/**