From 6361635b55e056cb03ed41bbe7f4eb922bc9c26f Mon Sep 17 00:00:00 2001 From: Asher Date: Mon, 8 Apr 2019 11:01:12 -0500 Subject: [PATCH] Move backup service init to the shared process Since this is where it attempts to read it, this should solve the JSON errors for good. --- packages/vscode/src/workbench.ts | 10 ---------- scripts/vscode.patch | 10 ++++++++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/packages/vscode/src/workbench.ts b/packages/vscode/src/workbench.ts index 826cb176..c2499e87 100644 --- a/packages/vscode/src/workbench.ts +++ b/packages/vscode/src/workbench.ts @@ -29,8 +29,6 @@ import { LogLevel } from "vs/platform/log/common/log"; import { RawContextKey, IContextKeyService } from "vs/platform/contextkey/common/contextkey"; import { ServiceCollection } from "vs/platform/instantiation/common/serviceCollection"; import { URI } from "vs/base/common/uri"; -import { BackupMainService } from "vs/platform/backup/electron-main/backupMainService"; -import { IInstantiationService } from "vs/platform/instantiation/common/instantiation"; /** * Initializes VS Code and provides a way to call into general client @@ -131,14 +129,6 @@ export class Workbench { public set serviceCollection(collection: ServiceCollection) { this._serviceCollection = collection; - // TODO: If possible it might be better to start the app from vs/code/electron-main/app. - // For now, manually initialize services from there as needed. - const inst = this._serviceCollection.get(IInstantiationService) as IInstantiationService; - const backupMainService = inst.createInstance(BackupMainService) as BackupMainService; - backupMainService.initialize().catch((error) => { - logger.error(error.message); - }); - const contextKeys = this.serviceCollection.get(IContextKeyService) as IContextKeyService; const bounded = this.clipboardContextKey.bindTo(contextKeys); client.clipboard.onPermissionChange((enabled) => { diff --git a/scripts/vscode.patch b/scripts/vscode.patch index 6e90c232..1f666eac 100644 --- a/scripts/vscode.patch +++ b/scripts/vscode.patch @@ -138,10 +138,16 @@ index e0ff793..885de12 100644 - const cmdOrCtrlKey = platform.isMacintosh ? e.metaKey : e.ctrlKey; + const cmdOrCtrlKey = browser.isMacintosh ? e.metaKey : e.ctrlKey; diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts -index 6fd8249..796aed7 100644 +index 6fd8249..039d31a 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts -@@ -223,0 +224,2 @@ async function handshake(configuration: ISharedProcessConfiguration): Promise