Skip to content

Commit 4e46d87

Browse files
Use name from file tree instead of calculating from path
1 parent a8f8990 commit 4e46d87

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class QueryTreeDataProvider
3939
fileTreeDirectory: FileTreeNode,
4040
): QueryTreeViewItem {
4141
return new QueryTreeViewItem(
42+
fileTreeDirectory.name,
4243
fileTreeDirectory.path,
4344
fileTreeDirectory.children.map(this.convertFileTreeNode.bind(this)),
4445
);

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import * as vscode from "vscode";
2-
import { basename } from "path";
32

43
export class QueryTreeViewItem extends vscode.TreeItem {
5-
constructor(path: string, public readonly children: QueryTreeViewItem[]) {
6-
super(basename(path));
4+
constructor(
5+
name: string,
6+
path: string,
7+
public readonly children: QueryTreeViewItem[],
8+
) {
9+
super(name);
710
this.tooltip = path;
811
this.collapsibleState = this.children.length
912
? vscode.TreeItemCollapsibleState.Collapsed

0 commit comments

Comments
 (0)