Converge addFileSchema implementation
This commit is contained in:
parent
01b0b055d0
commit
7441f553c4
3 changed files with 3 additions and 11 deletions
|
@ -145,7 +145,9 @@ export abstract class AbstractFileDialogService implements IFileDialogService {
|
|||
}
|
||||
}
|
||||
|
||||
protected abstract addFileSchemaIfNeeded(schema: string): string[];
|
||||
protected addFileSchemaIfNeeded(schema: string): string[] {
|
||||
return schema === Schemas.untitled ? [Schemas.file] : (schema !== Schemas.file ? [schema, Schemas.file] : [schema]);
|
||||
}
|
||||
|
||||
protected async pickFileFolderAndOpenSimplified(schema: string, options: IPickAndOpenOptions, preferNewWindow: boolean): Promise<any> {
|
||||
const title = nls.localize('openFileOrFolder.title', 'Open File Or Folder');
|
||||
|
|
|
@ -130,10 +130,6 @@ export class FileDialogService extends AbstractFileDialogService implements IFil
|
|||
return [uri];
|
||||
}
|
||||
|
||||
protected addFileSchemaIfNeeded(schema: string): string[] {
|
||||
return schema === Schemas.untitled ? [Schemas.file] : [schema];
|
||||
}
|
||||
|
||||
private shouldUseSimplified(scheme: string): boolean {
|
||||
return ![Schemas.file, Schemas.userData, Schemas.tmp].includes(scheme);
|
||||
}
|
||||
|
|
|
@ -187,12 +187,6 @@ export class FileDialogService extends AbstractFileDialogService implements IFil
|
|||
const result = await this.nativeHostService.showOpenDialog(newOptions);
|
||||
return result && Array.isArray(result.filePaths) && result.filePaths.length > 0 ? result.filePaths.map(URI.file) : undefined;
|
||||
}
|
||||
|
||||
protected addFileSchemaIfNeeded(schema: string): string[] {
|
||||
// Include File schema unless the schema is web
|
||||
// Don't allow untitled schema through.
|
||||
return schema === Schemas.untitled ? [Schemas.file] : (schema !== Schemas.file ? [schema, Schemas.file] : [schema]);
|
||||
}
|
||||
}
|
||||
|
||||
registerSingleton(IFileDialogService, FileDialogService, true);
|
||||
|
|
Loading…
Reference in a new issue