From 8654f9cb0622d62dd30b8a8000bb812e56fbc0da Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 30 Jan 2019 13:13:04 -0600 Subject: [PATCH] Fix client not using log dir from shared proc Needed the path set promise to run first. And removed the protocol promise stuff that was hanging around not doing anything useful. --- packages/vscode/src/client.ts | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/packages/vscode/src/client.ts b/packages/vscode/src/client.ts index 0c7fb7bec..6154df3b3 100644 --- a/packages/vscode/src/client.ts +++ b/packages/vscode/src/client.ts @@ -15,36 +15,23 @@ import { toLocalISOString } from "vs/base/common/date"; // import { RawContextKey, IContextKeyService } from "vs/platform/contextkey/common/contextkey"; import { URI } from "vs/base/common/uri"; -import { Protocol } from "vs/base/parts/ipc/node/ipc.net"; - export class Client extends IDEClient { private readonly windowId = parseInt(toLocalISOString(new Date()).replace(/[-:.TZ]/g, ""), 10); - public readonly protocolPromise: Promise; - public protoResolve: ((protocol: Protocol) => void) | undefined; - private readonly pathSets: Promise; - - public constructor() { - super(); - this.protocolPromise = new Promise((resolve): void => { - this.protoResolve = resolve; - }); - this.pathSets = this.sharedProcessData.then((data) => { - paths._paths.socketPath = data.socketPath; - process.env.VSCODE_LOGS = data.logPath; - }); - this.initData.then((data) => { - paths._paths.appData = data.dataDirectory; - paths._paths.defaultUserData = data.dataDirectory; - process.env.SHELL = data.shell; - }); - } - protected initialize(): Promise { registerContextMenuListener(); + const pathSets = this.sharedProcessData.then((data) => { + paths._paths.socketPath = data.socketPath; + process.env.VSCODE_LOGS = data.logPath; + }); + return this.task("Start workbench", 1000, async (data) => { + paths._paths.appData = data.dataDirectory; + paths._paths.defaultUserData = data.dataDirectory; + process.env.SHELL = data.shell; + const { startup } = require("./startup"); await startup({ machineId: "1", @@ -96,7 +83,7 @@ export class Client extends IDEClient { // bounded.set(enabled); // }); this.clipboard.initialize(); - }, this.initData, this.pathSets); + }, this.initData, pathSets); } protected createUriFactory(): IURIFactory {