Use name from file tree instead of calculating from path
This commit is contained in:
@@ -39,6 +39,7 @@ export class QueryTreeDataProvider
|
||||
fileTreeDirectory: FileTreeNode,
|
||||
): QueryTreeViewItem {
|
||||
return new QueryTreeViewItem(
|
||||
fileTreeDirectory.name,
|
||||
fileTreeDirectory.path,
|
||||
fileTreeDirectory.children.map(this.convertFileTreeNode.bind(this)),
|
||||
);
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import * as vscode from "vscode";
|
||||
import { basename } from "path";
|
||||
|
||||
export class QueryTreeViewItem extends vscode.TreeItem {
|
||||
constructor(path: string, public readonly children: QueryTreeViewItem[]) {
|
||||
super(basename(path));
|
||||
constructor(
|
||||
name: string,
|
||||
path: string,
|
||||
public readonly children: QueryTreeViewItem[],
|
||||
) {
|
||||
super(name);
|
||||
this.tooltip = path;
|
||||
this.collapsibleState = this.children.length
|
||||
? vscode.TreeItemCollapsibleState.Collapsed
|
||||
|
||||
Reference in New Issue
Block a user