update workspace opening popup to be modal (#14741)

This commit is contained in:
Kim Santiago
2021-03-16 11:36:10 -07:00
committed by GitHub
parent 95fa61ee4e
commit ff766a8a14

View File

@@ -27,7 +27,7 @@ export class WorkspaceService implements IWorkspaceService {
} }
/** /**
* Load any temp project that needed to be loaded before the extension host was restarted * Load any temp project that needed to be loaded before ADS was restarted
* which would happen if a workspace was created in order open or create a project * which would happen if a workspace was created in order open or create a project
*/ */
async loadTempProjects(): Promise<void> { async loadTempProjects(): Promise<void> {
@@ -43,7 +43,7 @@ export class WorkspaceService implements IWorkspaceService {
} }
/** /**
* Creates a new workspace in the same folder as the project. Because the extension host gets restarted when * Creates a new workspace in the same folder as the project. Because ADS gets restarted when
* a new workspace is created and opened, the project needs to be saved as the temp project that will be loaded * a new workspace is created and opened, the project needs to be saved as the temp project that will be loaded
* when the extension gets restarted * when the extension gets restarted
* @param projectFileFsPath project to add to the workspace * @param projectFileFsPath project to add to the workspace
@@ -74,11 +74,11 @@ export class WorkspaceService implements IWorkspaceService {
} }
/** /**
* Verify that a workspace is open or that if one isn't, it's ok to create a workspace and restart the extension host * Verify that a workspace is open or that if one isn't, it's ok to create a workspace and restart ADS
*/ */
async validateWorkspace(): Promise<boolean> { async validateWorkspace(): Promise<boolean> {
if (!vscode.workspace.workspaceFile || isCurrentWorkspaceUntitled()) { if (!vscode.workspace.workspaceFile || isCurrentWorkspaceUntitled()) {
const result = await vscode.window.showWarningMessage(constants.CreateWorkspaceConfirmation, constants.OkButtonText, constants.CancelButtonText); const result = await vscode.window.showWarningMessage(constants.CreateWorkspaceConfirmation, { modal: true }, constants.OkButtonText);
if (result === constants.OkButtonText) { if (result === constants.OkButtonText) {
return true; return true;
} else { } else {
@@ -91,11 +91,11 @@ export class WorkspaceService implements IWorkspaceService {
} }
/** /**
* Shows confirmation message that the extension host will be restarted and current workspace/file will be closed. If confirmed, the specified workspace will be entered. * Shows confirmation message that the ADS will be restarted and current workspace/file will be closed. If confirmed, the specified workspace will be entered.
* @param workspaceFile * @param workspaceFile
*/ */
async enterWorkspace(workspaceFile: vscode.Uri): Promise<void> { async enterWorkspace(workspaceFile: vscode.Uri): Promise<void> {
const result = await vscode.window.showWarningMessage(constants.EnterWorkspaceConfirmation, constants.OkButtonText, constants.CancelButtonText); const result = await vscode.window.showWarningMessage(constants.EnterWorkspaceConfirmation, { modal: true }, constants.OkButtonText);
if (result === constants.OkButtonText) { if (result === constants.OkButtonText) {
await azdata.workspace.enterWorkspace(workspaceFile); await azdata.workspace.enterWorkspace(workspaceFile);
} else { } else {
@@ -112,7 +112,7 @@ export class WorkspaceService implements IWorkspaceService {
if (!vscode.workspace.workspaceFile || isCurrentWorkspaceUntitled()) { if (!vscode.workspace.workspaceFile || isCurrentWorkspaceUntitled()) {
await this.CreateNewWorkspaceForProject(projectFiles[0].fsPath, workspaceFilePath); await this.CreateNewWorkspaceForProject(projectFiles[0].fsPath, workspaceFilePath);
// this won't get hit since the extension host will get restarted, but helps with testing // this won't get hit since ADS will get restarted, but helps with testing
return; return;
} }