Update to VS Code 1.52.1
This commit is contained in:
@@ -45,12 +45,16 @@ import { ConfigurationCache } from 'vs/workbench/services/configuration/electron
|
||||
import { SignService } from 'vs/platform/sign/node/signService';
|
||||
import { ISignService } from 'vs/platform/sign/common/sign';
|
||||
import { FileUserDataProvider } from 'vs/workbench/services/userData/common/fileUserDataProvider';
|
||||
import { basename } from 'vs/base/common/resources';
|
||||
import { basename } from 'vs/base/common/path';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { NativeLogService } from 'vs/workbench/services/log/electron-browser/logService';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { NativeHostService } from 'vs/platform/native/electron-sandbox/nativeHostService';
|
||||
import { IUriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentity';
|
||||
import { UriIdentityService } from 'vs/workbench/services/uriIdentity/common/uriIdentityService';
|
||||
import { KeyboardLayoutService } from 'vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayout';
|
||||
import { IKeyboardLayoutService } from 'vs/platform/keyboardLayout/common/keyboardLayout';
|
||||
|
||||
class DesktopMain extends Disposable {
|
||||
|
||||
@@ -232,8 +236,11 @@ class DesktopMain extends Disposable {
|
||||
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
|
||||
|
||||
// User Data Provider
|
||||
fileService.registerProvider(Schemas.userData, new FileUserDataProvider(this.environmentService.appSettingsHome, this.configuration.backupPath ? URI.file(this.configuration.backupPath) : undefined, diskFileSystemProvider, this.environmentService, logService));
|
||||
fileService.registerProvider(Schemas.userData, new FileUserDataProvider(Schemas.file, diskFileSystemProvider, Schemas.userData, logService));
|
||||
|
||||
// Uri Identity
|
||||
const uriIdentityService = new UriIdentityService(fileService);
|
||||
serviceCollection.set(IUriIdentityService, uriIdentityService);
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//
|
||||
@@ -257,7 +264,7 @@ class DesktopMain extends Disposable {
|
||||
const payload = await this.resolveWorkspaceInitializationPayload();
|
||||
|
||||
const services = await Promise.all([
|
||||
this.createWorkspaceService(payload, fileService, remoteAgentService, logService).then(service => {
|
||||
this.createWorkspaceService(payload, fileService, remoteAgentService, uriIdentityService, logService).then(service => {
|
||||
|
||||
// Workspace
|
||||
serviceCollection.set(IWorkspaceContextService, service);
|
||||
@@ -273,6 +280,14 @@ class DesktopMain extends Disposable {
|
||||
// Storage
|
||||
serviceCollection.set(IStorageService, service);
|
||||
|
||||
return service;
|
||||
}),
|
||||
|
||||
this.createKeyboardLayoutService(logService, mainProcessService).then(service => {
|
||||
|
||||
// KeyboardLayout
|
||||
serviceCollection.set(IKeyboardLayoutService, service);
|
||||
|
||||
return service;
|
||||
})
|
||||
]);
|
||||
@@ -310,8 +325,8 @@ class DesktopMain extends Disposable {
|
||||
// Fallback to empty workspace if we have no payload yet.
|
||||
if (!workspaceInitializationPayload) {
|
||||
let id: string;
|
||||
if (this.environmentService.backupWorkspaceHome) {
|
||||
id = basename(this.environmentService.backupWorkspaceHome); // we know the backupPath must be a unique path so we leverage its name as workspace ID
|
||||
if (this.configuration.backupPath) {
|
||||
id = basename(this.configuration.backupPath); // we know the backupPath must be a unique path so we leverage its name as workspace ID
|
||||
} else if (this.environmentService.isExtensionDevelopment) {
|
||||
id = 'ext-dev'; // extension development window never stores backups and is a singleton
|
||||
} else {
|
||||
@@ -334,10 +349,12 @@ class DesktopMain extends Disposable {
|
||||
} catch (error) {
|
||||
onUnexpectedError(error);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
private async createHash(resource: URI): Promise<string> {
|
||||
|
||||
// Return early the folder is not local
|
||||
if (resource.scheme !== Schemas.file) {
|
||||
return createHash('md5').update(resource.toString()).digest('hex');
|
||||
@@ -362,8 +379,8 @@ class DesktopMain extends Disposable {
|
||||
return createHash('md5').update(resource.fsPath).update(ctime ? String(ctime) : '').digest('hex');
|
||||
}
|
||||
|
||||
private async createWorkspaceService(payload: IWorkspaceInitializationPayload, fileService: FileService, remoteAgentService: IRemoteAgentService, logService: ILogService): Promise<WorkspaceService> {
|
||||
const workspaceService = new WorkspaceService({ remoteAuthority: this.environmentService.remoteAuthority, configurationCache: new ConfigurationCache(this.environmentService) }, this.environmentService, fileService, remoteAgentService, logService);
|
||||
private async createWorkspaceService(payload: IWorkspaceInitializationPayload, fileService: FileService, remoteAgentService: IRemoteAgentService, uriIdentityService: IUriIdentityService, logService: ILogService): Promise<WorkspaceService> {
|
||||
const workspaceService = new WorkspaceService({ remoteAuthority: this.environmentService.remoteAuthority, configurationCache: new ConfigurationCache(this.environmentService) }, this.environmentService, fileService, remoteAgentService, uriIdentityService, logService);
|
||||
|
||||
try {
|
||||
await workspaceService.initialize(payload);
|
||||
@@ -393,6 +410,20 @@ class DesktopMain extends Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private async createKeyboardLayoutService(logService: ILogService, mainProcessService: IMainProcessService): Promise<KeyboardLayoutService> {
|
||||
const keyboardLayoutService = new KeyboardLayoutService(mainProcessService);
|
||||
|
||||
try {
|
||||
await keyboardLayoutService.initialize();
|
||||
|
||||
return keyboardLayoutService;
|
||||
} catch (error) {
|
||||
onUnexpectedError(error);
|
||||
logService.error(error);
|
||||
|
||||
return keyboardLayoutService;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function main(configuration: INativeWorkbenchConfiguration): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user