From 351ab2f40fda2a94e7aa1054c0cfce47f637c07e Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Mon, 13 Jul 2020 13:25:05 -0700 Subject: [PATCH] fix default connection group by changing ordering of groups (#11303) --- .../services/connection/browser/connectionController.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sql/workbench/services/connection/browser/connectionController.ts b/src/sql/workbench/services/connection/browser/connectionController.ts index dd15329b91..e4f76d50e5 100644 --- a/src/sql/workbench/services/connection/browser/connectionController.ts +++ b/src/sql/workbench/services/connection/browser/connectionController.ts @@ -147,9 +147,6 @@ export class ConnectionController implements IConnectionComponentController { private getAllServerGroups(providers?: string[]): IConnectionProfileGroup[] { let connectionGroupRoot = this._connectionManagementService.getConnectionGroups(providers); let allGroups: IConnectionProfileGroup[] = []; - if (connectionGroupRoot && connectionGroupRoot.length > 0) { - this.flattenGroups(connectionGroupRoot[0], allGroups); - } let defaultGroupId: string; if (connectionGroupRoot && connectionGroupRoot.length > 0 && ConnectionProfileGroup.isRoot(connectionGroupRoot[0].name)) { defaultGroupId = connectionGroupRoot[0].id; @@ -158,6 +155,9 @@ export class ConnectionController implements IConnectionComponentController { } allGroups.push(assign({}, this._connectionWidget.DefaultServerGroup, { id: defaultGroupId })); allGroups.push(this._connectionWidget.NoneServerGroup); + if (connectionGroupRoot && connectionGroupRoot.length > 0) { + this.flattenGroups(connectionGroupRoot[0], allGroups); + } connectionGroupRoot.forEach(cpg => cpg.dispose()); return allGroups; }