mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
Merge from vscode a234f13c45b40a0929777cb440ee011b7549eed2 (#8911)
* Merge from vscode a234f13c45b40a0929777cb440ee011b7549eed2 * update distro * fix layering * update distro * fix tests
This commit is contained in:
@@ -35,6 +35,7 @@ import { ICommandHandler } from 'vs/platform/commands/common/commands';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { normalizeDriveLetter } from 'vs/base/common/labels';
|
||||
import { SaveReason } from 'vs/workbench/common/editor';
|
||||
import { IRemotePathService } from 'vs/workbench/services/path/common/remotePathService';
|
||||
|
||||
export namespace OpenLocalFileCommand {
|
||||
export const ID = 'workbench.action.files.openLocalFile';
|
||||
@@ -134,6 +135,7 @@ export class SimpleFileDialog {
|
||||
@IModeService private readonly modeService: IModeService,
|
||||
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
||||
@IRemoteAgentService private readonly remoteAgentService: IRemoteAgentService,
|
||||
@IRemotePathService private readonly remotePathService: IRemotePathService,
|
||||
@IKeybindingService private readonly keybindingService: IKeybindingService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
) {
|
||||
@@ -154,8 +156,8 @@ export class SimpleFileDialog {
|
||||
|
||||
public async showOpenDialog(options: IOpenDialogOptions = {}): Promise<URI | undefined> {
|
||||
this.scheme = this.getScheme(options.availableFileSystems, options.defaultUri);
|
||||
this.userHome = await this.getUserHome();
|
||||
const newOptions = await this.getOptions(options);
|
||||
this.userHome = await this.remotePathService.userHome;
|
||||
const newOptions = this.getOptions(options);
|
||||
if (!newOptions) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
@@ -165,9 +167,9 @@ export class SimpleFileDialog {
|
||||
|
||||
public async showSaveDialog(options: ISaveDialogOptions): Promise<URI | undefined> {
|
||||
this.scheme = this.getScheme(options.availableFileSystems, options.defaultUri);
|
||||
this.userHome = await this.getUserHome();
|
||||
this.userHome = await this.remotePathService.userHome;
|
||||
this.requiresTrailing = true;
|
||||
const newOptions = await this.getOptions(options, true);
|
||||
const newOptions = this.getOptions(options, true);
|
||||
if (!newOptions) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
@@ -229,16 +231,6 @@ export class SimpleFileDialog {
|
||||
return this.remoteAgentEnvironment;
|
||||
}
|
||||
|
||||
private async getUserHome(): Promise<URI> {
|
||||
if (this.scheme !== Schemas.file) {
|
||||
const env = await this.getRemoteAgentEnvironment();
|
||||
if (env) {
|
||||
return env.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;
|
||||
|
||||
Reference in New Issue
Block a user