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.
This commit is contained in:
Asher 2019-04-08 11:01:12 -05:00
parent d2da4cfc43
commit 6361635b55
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC
2 changed files with 8 additions and 12 deletions

View File

@ -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) => {

View File

@ -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<vo
@@ -50,0 +51 @@ import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiatio
+import { BackupMainService } from 'vs/platform/backup/electron-main/backupMainService';
@@ -120,0 +122,3 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
+ const backupMainService = instantiationService.createInstance(BackupMainService) as BackupMainService;
+ backupMainService.initialize().catch(console.error);
+
@@ -223,0 +228,2 @@ async function handshake(configuration: ISharedProcessConfiguration): Promise<vo
+
+startup({ machineId: "1" });
diff --git a/src/vs/editor/browser/config/configuration.ts b/src/vs/editor/browser/config/configuration.ts