diff --git a/extensions/sql-database-projects/src/controllers/mainController.ts b/extensions/sql-database-projects/src/controllers/mainController.ts index 935432012f..a8cb704944 100644 --- a/extensions/sql-database-projects/src/controllers/mainController.ts +++ b/extensions/sql-database-projects/src/controllers/mainController.ts @@ -106,7 +106,8 @@ export default class MainController implements vscode.Disposable { let results = await glob(sqlprojFilter); for (let f in results) { - await this.projectsController.openProject(vscode.Uri.file(results[f])); + // open the project, but don't switch focus to the file explorer viewlet + await this.projectsController.openProject(vscode.Uri.file(results[f]), false); } } diff --git a/extensions/sql-database-projects/src/controllers/projectController.ts b/extensions/sql-database-projects/src/controllers/projectController.ts index 302aaa908c..8b815af48e 100644 --- a/extensions/sql-database-projects/src/controllers/projectController.ts +++ b/extensions/sql-database-projects/src/controllers/projectController.ts @@ -47,7 +47,7 @@ export class ProjectsController { this.projectTreeViewProvider.load(this.projects); } - public async openProject(projectFile: vscode.Uri): Promise { + public async openProject(projectFile: vscode.Uri, focusProject: boolean = true): Promise { for (const proj of this.projects) { if (proj.projectFilePath === projectFile.fsPath) { vscode.window.showInformationMessage(constants.projectAlreadyOpened(projectFile.fsPath)); @@ -81,7 +81,10 @@ export class ProjectsController { } this.refreshProjectsTree(); - await this.focusProject(newProject); + + if (focusProject) { + await this.focusProject(newProject); + } } catch (err) { // if the project didnt load - remove it from the list of open projects