From bdf555a06e5dd994054a2af8cdd9bffd1a2dcc77 Mon Sep 17 00:00:00 2001 From: Akash Satheesan Date: Fri, 16 Apr 2021 00:14:16 +0530 Subject: [PATCH] fix(lib/vscode): refactor productService --- lib/vscode/src/vs/server/node/server.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/vscode/src/vs/server/node/server.ts b/lib/vscode/src/vs/server/node/server.ts index f2153276..a44cbd0b 100644 --- a/lib/vscode/src/vs/server/node/server.ts +++ b/lib/vscode/src/vs/server/node/server.ts @@ -209,7 +209,8 @@ export class Vscode { // ../../electron-browser/sharedProcess/sharedProcessMain.ts#L148 // ../../../code/electron-main/app.ts private async initializeServices(args: NativeParsedArgs): Promise { - const environmentService = new NativeEnvironmentService(args, this.services.get(IProductService) as IProductService); + const productService = { _serviceBrand: undefined, ...product }; + const environmentService = new NativeEnvironmentService(args, productService); // https://github.com/cdr/code-server/issues/1693 fs.mkdirSync(environmentService.globalStorageHome.fsPath, { recursive: true }); const logService = new MultiplexLogService([ @@ -244,7 +245,7 @@ export class Vscode { this.services.set(IRequestService, new SyncDescriptor(RequestService)); this.services.set(IFileService, fileService); - this.services.set(IProductService, { _serviceBrand: undefined, ...product }); + this.services.set(IProductService, productService); const machineId = await getMachineId();