Wrong order for configuration priority + only return one per name

pull/13/head
Kelvin Schoofs 7 years ago
parent 4303682110
commit b276fc9cba

@ -249,11 +249,12 @@ export class Manager implements vscode.FileSystemProvider, vscode.TreeDataProvid
const config = vscode.workspace.getConfiguration('sshfs'); const config = vscode.workspace.getConfiguration('sshfs');
if (!config) return []; if (!config) return [];
const inspect = config.inspect<FileSystemConfig[]>('configs')!; const inspect = config.inspect<FileSystemConfig[]>('configs')!;
const configs: FileSystemConfig[] = [ let configs: FileSystemConfig[] = [
...(inspect.globalValue || []),
...(inspect.workspaceValue || []),
...(inspect.workspaceFolderValue || []), ...(inspect.workspaceFolderValue || []),
...(inspect.workspaceValue || []),
...(inspect.globalValue || []),
]; ];
configs = configs.filter((c, i) => configs.findIndex(c2 => c2.name === c.name) === i);
for (const index in configs) { for (const index in configs) {
if (!configs[index].name) { if (!configs[index].name) {
vscode.window.showErrorMessage(`Skipped an invalid SSH FS config (missing a name field)`); vscode.window.showErrorMessage(`Skipped an invalid SSH FS config (missing a name field)`);

Loading…
Cancel
Save