Small code improvements

feature/forwarding
Kelvin Schoofs 4 years ago
parent 7a779f84d2
commit 9f988d43ef

@ -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());
}

@ -1,5 +1,5 @@
export type toPromiseCallback<T> = (err?: Error | null, res?: T) => void;
export type toPromiseCallback<T> = (err?: Error | null | void, res?: T) => void;
export async function toPromise<T>(func: (cb: toPromiseCallback<T>) => void): Promise<T> {
return new Promise<T>((resolve, reject) => {
try {

@ -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

Loading…
Cancel
Save