From 3e9b694e6f3dfae695c01e3641e66666aba0ba67 Mon Sep 17 00:00:00 2001 From: Kim Santiago <31145923+kisantia@users.noreply.github.com> Date: Mon, 9 Sep 2019 13:21:35 -0700 Subject: [PATCH] Update dacpac and schema compare extensions to not use deprecated workspace.rootPath (#7125) --- extensions/dacpac/src/wizard/api/dacFxConfigPage.ts | 2 +- extensions/schema-compare/src/dialogs/schemaCompareDialog.ts | 2 +- extensions/schema-compare/src/schemaCompareMainWindow.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts b/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts index c500fb6c5d..793a3c44a7 100644 --- a/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts +++ b/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts @@ -182,7 +182,7 @@ export abstract class DacFxConfigPage extends BasePage { if (this.fileTextBox.value && path.dirname(this.fileTextBox.value)) { return path.dirname(this.fileTextBox.value); } else { // otherwise use the folder open in the Explorer or the home directory - return vscode.workspace.rootPath ? vscode.workspace.rootPath : os.homedir(); + return vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].name : os.homedir(); } } diff --git a/extensions/schema-compare/src/dialogs/schemaCompareDialog.ts b/extensions/schema-compare/src/dialogs/schemaCompareDialog.ts index ee6284f8f1..297e2f8d79 100644 --- a/extensions/schema-compare/src/dialogs/schemaCompareDialog.ts +++ b/extensions/schema-compare/src/dialogs/schemaCompareDialog.ts @@ -306,7 +306,7 @@ export class SchemaCompareDialog { currentButton.onDidClick(async (click) => { // file browser should open where the current dacpac is or the appropriate default folder - let rootPath = vscode.workspace.rootPath ? vscode.workspace.rootPath : os.homedir(); + let rootPath = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].name : os.homedir(); let defaultUri = endpoint && endpoint.packageFilePath && existsSync(endpoint.packageFilePath) ? endpoint.packageFilePath : rootPath; let fileUris = await vscode.window.showOpenDialog( diff --git a/extensions/schema-compare/src/schemaCompareMainWindow.ts b/extensions/schema-compare/src/schemaCompareMainWindow.ts index f30ab4a744..c515ea6329 100644 --- a/extensions/schema-compare/src/schemaCompareMainWindow.ts +++ b/extensions/schema-compare/src/schemaCompareMainWindow.ts @@ -845,7 +845,7 @@ export class SchemaCompareMainWindow { this.openScmpButton.onDidClick(async (click) => { Telemetry.sendTelemetryEvent('SchemaCompareOpenScmpStarted'); - const rootPath = vscode.workspace.rootPath ? vscode.workspace.rootPath : os.homedir(); + const rootPath = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].name : os.homedir(); let fileUris = await vscode.window.showOpenDialog( { canSelectFiles: true, @@ -942,7 +942,7 @@ export class SchemaCompareMainWindow { }).component(); this.saveScmpButton.onDidClick(async (click) => { - const rootPath = vscode.workspace.rootPath ? vscode.workspace.rootPath : os.homedir(); + const rootPath = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].name : os.homedir(); const filePath = await vscode.window.showSaveDialog( { defaultUri: vscode.Uri.file(rootPath),