mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
Merge from vscode e5834d3280fcd04898efeac32b9cf1b893f9b127 (#9385)
* Merge from vscode e5834d3280fcd04898efeac32b9cf1b893f9b127 * distro
This commit is contained in:
@@ -92,6 +92,10 @@ export abstract class AbstractFileDialogService implements IFileDialogService {
|
||||
return ConfirmResult.DONT_SAVE; // no veto when we are in extension dev mode because we cannot assume we run interactive (e.g. tests)
|
||||
}
|
||||
|
||||
return this.doShowSaveConfirm(fileNamesOrResources);
|
||||
}
|
||||
|
||||
protected async doShowSaveConfirm(fileNamesOrResources: (string | URI)[]): Promise<ConfirmResult> {
|
||||
if (fileNamesOrResources.length === 0) {
|
||||
return ConfirmResult.DONT_SAVE;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ export class SimpleFileDialog {
|
||||
|
||||
public async showOpenDialog(options: IOpenDialogOptions = {}): Promise<URI | undefined> {
|
||||
this.scheme = this.getScheme(options.availableFileSystems, options.defaultUri);
|
||||
this.userHome = await this.remotePathService.userHome;
|
||||
this.userHome = await this.getUserHome();
|
||||
const newOptions = this.getOptions(options);
|
||||
if (!newOptions) {
|
||||
return Promise.resolve(undefined);
|
||||
@@ -167,7 +167,7 @@ export class SimpleFileDialog {
|
||||
|
||||
public async showSaveDialog(options: ISaveDialogOptions): Promise<URI | undefined> {
|
||||
this.scheme = this.getScheme(options.availableFileSystems, options.defaultUri);
|
||||
this.userHome = await this.remotePathService.userHome;
|
||||
this.userHome = await this.getUserHome();
|
||||
this.requiresTrailing = true;
|
||||
const newOptions = this.getOptions(options, true);
|
||||
if (!newOptions) {
|
||||
@@ -231,6 +231,13 @@ export class SimpleFileDialog {
|
||||
return this.remoteAgentEnvironment;
|
||||
}
|
||||
|
||||
private async getUserHome(): Promise<URI> {
|
||||
if (this.scheme !== Schemas.file) {
|
||||
return this.remotePathService.userHome;
|
||||
}
|
||||
return URI.from({ scheme: this.scheme, path: this.environmentService.userHome });
|
||||
}
|
||||
|
||||
private async pickResource(isSave: boolean = false): Promise<URI | undefined> {
|
||||
this.allowFolderSelection = !!this.options.canSelectFolders;
|
||||
this.allowFileSelection = !!this.options.canSelectFiles;
|
||||
|
||||
@@ -198,7 +198,7 @@ export class FileDialogService extends AbstractFileDialogService implements IFil
|
||||
}
|
||||
}
|
||||
|
||||
return super.showSaveConfirm(fileNamesOrResources);
|
||||
return super.doShowSaveConfirm(fileNamesOrResources);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user