This commit is contained in:
Benjamin Pasero 2022-02-17 13:04:29 +01:00
parent f865f66c91
commit 36ed074f8f
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65
4 changed files with 16 additions and 7 deletions

View file

@ -18,6 +18,15 @@ export namespace WebFileSystemAccess {
return false;
}
export function isFileSystemHandle(handle: unknown): handle is FileSystemHandle {
const candidate = handle as FileSystemHandle | undefined;
if (!candidate) {
return false;
}
return typeof candidate.kind === 'string' && typeof candidate.queryPermission === 'function' && typeof candidate.requestPermission === 'function';
}
export function isFileSystemFileHandle(handle: FileSystemHandle): handle is FileSystemFileHandle {
return handle.kind === 'file';
}

View file

@ -598,7 +598,7 @@ export class LifecycleMainService extends Disposable implements ILifecycleMainSe
async kill(code?: number): Promise<void> {
this.logService.trace('Lifecycle#kill()');
// Give main process participants a chance to oderly shutdown
// Give main process participants a chance to orderly shutdown
await this.fireOnWillShutdown();
// From extension tests we have seen issues where calling app.exit()

View file

@ -459,12 +459,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
const windowInitializationState: IWorkbenchLayoutWindowInitializationState = {
editor: {
restoreEditors: this.shouldRestoreEditors(this.contextService, initialFilesToOpen),
editorsToOpen: this.resolveEditorsToOpen(fileService, this.contextService, initialFilesToOpen),
editorsToOpen: this.resolveEditorsToOpen(fileService, initialFilesToOpen)
},
views: {
defaults: this.getDefaultLayoutViews(this.environmentService, this.storageService),
containerToRestore: {}
},
}
};
// Window Runtime State
@ -567,7 +567,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
return this.windowState.initialization.editor.restoreEditors;
}
private resolveEditorsToOpen(fileService: IFileService, contextService: IWorkspaceContextService, initialFilesToOpen: IInitialFilesToOpen | undefined): Promise<IUntypedEditorInput[]> | IUntypedEditorInput[] {
private resolveEditorsToOpen(fileService: IFileService, initialFilesToOpen: IInitialFilesToOpen | undefined): Promise<IUntypedEditorInput[]> | IUntypedEditorInput[] {
// Files to open, diff or create
if (initialFilesToOpen) {

View file

@ -225,6 +225,9 @@ export class DesktopMain extends Disposable {
const diskFileSystemProvider = this._register(new DiskFileSystemProvider(mainProcessService, sharedProcessWorkerWorkbenchService, logService));
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
// Remote Files
this._register(RemoteFileSystemProviderClient.register(remoteAgentService, fileService, logService));
// User Data Provider
fileService.registerProvider(Schemas.userData, this._register(new FileUserDataProvider(Schemas.file, diskFileSystemProvider, Schemas.userData, logService)));
@ -246,9 +249,6 @@ export class DesktopMain extends Disposable {
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Remote file system
this._register(RemoteFileSystemProviderClient.register(remoteAgentService, fileService, logService));
const payload = this.resolveWorkspaceInitializationPayload(environmentService);
const [configurationService, storageService] = await Promise.all([