Merge pull request #2423 from github/robertbrignull/query-tree-types
Simplify types around query panel
This commit is contained in:
@@ -32,9 +32,7 @@ export class QueryTreeDataProvider
|
||||
* @param item The item to represent.
|
||||
* @returns The UI presentation of the item.
|
||||
*/
|
||||
public getTreeItem(
|
||||
item: QueryTreeViewItem,
|
||||
): vscode.TreeItem | Thenable<vscode.TreeItem> {
|
||||
public getTreeItem(item: QueryTreeViewItem): vscode.TreeItem {
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -43,9 +41,7 @@ export class QueryTreeDataProvider
|
||||
* @param item The item to expand.
|
||||
* @returns The children of the item.
|
||||
*/
|
||||
public getChildren(
|
||||
item?: QueryTreeViewItem,
|
||||
): vscode.ProviderResult<QueryTreeViewItem[]> {
|
||||
public getChildren(item?: QueryTreeViewItem): QueryTreeViewItem[] {
|
||||
if (!item) {
|
||||
// We're at the root.
|
||||
return this.queryTreeItems;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import * as vscode from "vscode";
|
||||
|
||||
export class QueryTreeViewItem extends vscode.TreeItem {
|
||||
public collapsibleState: vscode.TreeItemCollapsibleState;
|
||||
constructor(
|
||||
public readonly label: string,
|
||||
public readonly tooltip: string | undefined,
|
||||
label: string,
|
||||
tooltip: string | undefined,
|
||||
public readonly children: QueryTreeViewItem[],
|
||||
) {
|
||||
super(label);
|
||||
this.tooltip = tooltip;
|
||||
this.collapsibleState = this.children.length
|
||||
? vscode.TreeItemCollapsibleState.Collapsed
|
||||
: vscode.TreeItemCollapsibleState.None;
|
||||
|
||||
Reference in New Issue
Block a user