Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/OneExplorer/OneExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,15 @@ export class OneTreeDataProvider implements vscode.TreeDataProvider<Node> {
private fileWatcher = vscode.workspace.createFileSystemWatcher(`**/*`);

private _tree: Node[] | undefined;
private _treeView: vscode.TreeView<Node> | undefined;
private _workspaceRoots: vscode.Uri[] = [];

public static didHideExtra: boolean = false;

public static register(context: vscode.ExtensionContext) {
const provider = new OneTreeDataProvider(context.extension.extensionKind);

const _treeView = vscode.window.createTreeView("OneExplorerView", {
provider._treeView = vscode.window.createTreeView("OneExplorerView", {
treeDataProvider: provider,
showCollapseAll: true,
canSelectMany: true,
Expand Down Expand Up @@ -513,13 +514,13 @@ export class OneTreeDataProvider implements vscode.TreeDataProvider<Node> {
);
provider.refresh();
}),
_treeView,
provider._treeView,
vscode.commands.registerCommand(
"one.explorer.revealInOneExplorer",
(path: string) => {
const node = OneStorage.getNode(path);
if (node) {
_treeView?.reveal(node, {
provider._treeView?.reveal(node, {
select: true,
focus: true,
expand: true,
Expand Down Expand Up @@ -686,6 +687,13 @@ export class OneTreeDataProvider implements vscode.TreeDataProvider<Node> {
vscode.commands.executeCommand("revealFileInOS", node.uri);
}

reveal(node: Node): void {
this._treeView?.reveal(node, {
select: true,
focus: true,
expand: true,
});
}
/**
* @brief A helper function to show input box to ask a new file name
*/
Expand Down