Fix bug where reconnecting a (or adding an extra) filesystem didn't actually add the workspace folder

pull/208/head
Kelvin Schoofs 4 years ago
parent cc8561d29f
commit b04e78886d

@ -344,12 +344,12 @@ export class Manager implements vscode.TreeDataProvider<string | FileSystemConfi
const config = typeof target === 'object' ? target : undefined; const config = typeof target === 'object' ? target : undefined;
if (typeof target === 'object') target = target.name; if (typeof target === 'object') target = target.name;
Logging.info(`Command received to connect ${target}`); Logging.info(`Command received to connect ${target}`);
const existing = this.fileSystems.find(fs => fs.config.name === target);
if (existing) return vscode.commands.executeCommand('workbench.files.action.refreshFilesExplorer');
const folders = vscode.workspace.workspaceFolders!; const folders = vscode.workspace.workspaceFolders!;
const folder = folders && folders.find(f => f.uri.scheme === 'ssh' && f.uri.authority === target); const folder = folders && folders.find(f => f.uri.scheme === 'ssh' && f.uri.authority === target);
if (folder) { if (folder) {
this.onDidChangeTreeDataEmitter.fire(null); this.onDidChangeTreeDataEmitter.fire(null);
const existing = this.fileSystems.find(fs => fs.config.name === target);
if (existing) return vscode.commands.executeCommand('workbench.files.action.refreshFilesExplorer');
return this.createFileSystem(target, config); return this.createFileSystem(target, config);
} }
vscode.workspace.updateWorkspaceFolders(folders ? folders.length : 0, 0, { uri: vscode.Uri.parse(`ssh://${target}/`), name: `SSH FS - ${target}` }); vscode.workspace.updateWorkspaceFolders(folders ? folders.length : 0, 0, { uri: vscode.Uri.parse(`ssh://${target}/`), name: `SSH FS - ${target}` });

Loading…
Cancel
Save