diff --git a/src/extension.ts b/src/extension.ts index 8051265..d3a5d37 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -54,8 +54,8 @@ export function activate(context: vscode.ExtensionContext) { subscribe(vscode.workspace.registerFileSystemProvider('ssh', new FileSystemRouter(manager), { isCaseSensitive: true })); subscribe(vscode.window.createTreeView('sshfs-configs', { treeDataProvider: new ConfigTreeProvider(), showCollapseAll: true })); - const connectionsTreeProvider = new ConnectionTreeProvider(manager.connectionManager); - subscribe(vscode.window.createTreeView('sshfs-connections', { treeDataProvider: connectionsTreeProvider, showCollapseAll: true })); + const connectionTreeProvider = new ConnectionTreeProvider(manager.connectionManager); + subscribe(vscode.window.createTreeView('sshfs-connections', { treeDataProvider: connectionTreeProvider, showCollapseAll: true })); subscribe(vscode.tasks.registerTaskProvider('ssh-shell', manager)); subscribe(vscode.window.registerTerminalLinkProvider(manager)); @@ -104,7 +104,7 @@ export function activate(context: vscode.ExtensionContext) { conns.getActiveConnections().forEach(conn => conns.closeConnection(conn, 'command:disconnectAll')); }); - // sshfs.termninal(target?: string | FileSystemConfig | Connection | vscode.Uri) + // sshfs.terminal(target?: FileSystemConfig | Connection | vscode.Uri) registerCommandHandler('sshfs.terminal', { promptOptions: { promptConfigs: true, promptConnections: true, promptInstantConnection: true }, handleConfig: config => manager.commandTerminal(config), @@ -140,5 +140,5 @@ export function activate(context: vscode.ExtensionContext) { registerCommand('sshfs.settings', () => manager.openSettings()); // sshfs.refresh() - registerCommand('sshfs.refresh', () => connectionsTreeProvider.refresh()); + registerCommand('sshfs.refresh', () => connectionTreeProvider.refresh()); } diff --git a/src/toPromise.ts b/src/toPromise.ts index 086d78b..4d5b790 100644 --- a/src/toPromise.ts +++ b/src/toPromise.ts @@ -1,5 +1,5 @@ -export type toPromiseCallback = (err?: Error | null, res?: T) => void; +export type toPromiseCallback = (err?: Error | null | void, res?: T) => void; export async function toPromise(func: (cb: toPromiseCallback) => void): Promise { return new Promise((resolve, reject) => { try { diff --git a/src/ui-utils.ts b/src/ui-utils.ts index 9ef1924..1eccf9d 100644 --- a/src/ui-utils.ts +++ b/src/ui-utils.ts @@ -42,6 +42,7 @@ export function formatItem(item: FileSystemConfig | Connection | SSHFileSystem | item, description, detail, tooltip: detail, label: `${iconInLabel ? '$(plug) ' : ''}${label || name} `, iconPath: new vscode.ThemeIcon('plug'), + collapsibleState: vscode.TreeItemCollapsibleState.Expanded, contextValue: 'connection', }; } else if ('onDidChangeFile' in item) { // SSHFileSystem