Skip to content

Commit fbb0208

Browse files
committed
File schema check was deleted from simple file dialog
Paritally reverts commit 5dfa261 Fixes microsoft#91687
1 parent 0bab257 commit fbb0208

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class SimpleFileDialog {
156156

157157
public async showOpenDialog(options: IOpenDialogOptions = {}): Promise<URI | undefined> {
158158
this.scheme = this.getScheme(options.availableFileSystems, options.defaultUri);
159-
this.userHome = await this.remotePathService.userHome;
159+
this.userHome = await this.getUserHome();
160160
const newOptions = this.getOptions(options);
161161
if (!newOptions) {
162162
return Promise.resolve(undefined);
@@ -167,7 +167,7 @@ export class SimpleFileDialog {
167167

168168
public async showSaveDialog(options: ISaveDialogOptions): Promise<URI | undefined> {
169169
this.scheme = this.getScheme(options.availableFileSystems, options.defaultUri);
170-
this.userHome = await this.remotePathService.userHome;
170+
this.userHome = await this.getUserHome();
171171
this.requiresTrailing = true;
172172
const newOptions = this.getOptions(options, true);
173173
if (!newOptions) {
@@ -231,6 +231,13 @@ export class SimpleFileDialog {
231231
return this.remoteAgentEnvironment;
232232
}
233233

234+
private async getUserHome(): Promise<URI> {
235+
if (this.scheme !== Schemas.file) {
236+
return this.remotePathService.userHome;
237+
}
238+
return URI.from({ scheme: this.scheme, path: this.environmentService.userHome });
239+
}
240+
234241
private async pickResource(isSave: boolean = false): Promise<URI | undefined> {
235242
this.allowFolderSelection = !!this.options.canSelectFolders;
236243
this.allowFileSelection = !!this.options.canSelectFiles;

0 commit comments

Comments
 (0)