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