Skip to content

Commit baea365

Browse files
Merge pull request github#2423 from github/robertbrignull/query-tree-types
Simplify types around query panel
2 parents 9ce95a3 + 1ceccc8 commit baea365

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

extensions/ql-vscode/src/queries-panel/query-tree-data-provider.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ export class QueryTreeDataProvider
3232
* @param item The item to represent.
3333
* @returns The UI presentation of the item.
3434
*/
35-
public getTreeItem(
36-
item: QueryTreeViewItem,
37-
): vscode.TreeItem | Thenable<vscode.TreeItem> {
35+
public getTreeItem(item: QueryTreeViewItem): vscode.TreeItem {
3836
return item;
3937
}
4038

@@ -43,9 +41,7 @@ export class QueryTreeDataProvider
4341
* @param item The item to expand.
4442
* @returns The children of the item.
4543
*/
46-
public getChildren(
47-
item?: QueryTreeViewItem,
48-
): vscode.ProviderResult<QueryTreeViewItem[]> {
44+
public getChildren(item?: QueryTreeViewItem): QueryTreeViewItem[] {
4945
if (!item) {
5046
// We're at the root.
5147
return this.queryTreeItems;

extensions/ql-vscode/src/queries-panel/query-tree-view-item.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as vscode from "vscode";
22

33
export class QueryTreeViewItem extends vscode.TreeItem {
4-
public collapsibleState: vscode.TreeItemCollapsibleState;
54
constructor(
6-
public readonly label: string,
7-
public readonly tooltip: string | undefined,
5+
label: string,
6+
tooltip: string | undefined,
87
public readonly children: QueryTreeViewItem[],
98
) {
109
super(label);
10+
this.tooltip = tooltip;
1111
this.collapsibleState = this.children.length
1212
? vscode.TreeItemCollapsibleState.Collapsed
1313
: vscode.TreeItemCollapsibleState.None;

0 commit comments

Comments
 (0)