Update dacpac and schema compare extensions to not use deprecated workspace.rootPath (#7125)

This commit is contained in:
Kim Santiago
2019-09-09 13:21:35 -07:00
committed by GitHub
parent b1eef13bb0
commit 3e9b694e6f
3 changed files with 4 additions and 4 deletions

View File

@@ -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(

View File

@@ -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),