From b276fc9cba39e84b9116d904c251228cc4d233bd Mon Sep 17 00:00:00 2001 From: Kelvin Schoofs Date: Sun, 6 May 2018 15:38:43 +0200 Subject: [PATCH] Wrong order for configuration priority + only return one per name --- src/manager.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/manager.ts b/src/manager.ts index 478c15b..bff5b7e 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -249,11 +249,12 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid const config = vscode.workspace.getConfiguration('sshfs'); if (!config) return []; const inspect = config.inspect('configs')!; - const configs: FileSystemConfig[] = [ - ...(inspect.globalValue || []), - ...(inspect.workspaceValue || []), + let configs: FileSystemConfig[] = [ ...(inspect.workspaceFolderValue || []), + ...(inspect.workspaceValue || []), + ...(inspect.globalValue || []), ]; + configs = configs.filter((c, i) => configs.findIndex(c2 => c2.name === c.name) === i); for (const index in configs) { if (!configs[index].name) { vscode.window.showErrorMessage(`Skipped an invalid SSH FS config (missing a name field)`);