From ddf96077a3b69daf54697cbee5596dfdb7dd0f63 Mon Sep 17 00:00:00 2001 From: Asher Date: Wed, 6 Feb 2019 11:01:15 -0600 Subject: [PATCH] Pass builtin extension dir to vscode --- packages/vscode/src/client.ts | 10 ++++++++++ scripts/vscode.patch | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/packages/vscode/src/client.ts b/packages/vscode/src/client.ts index 2488912b0..bddbb9630 100644 --- a/packages/vscode/src/client.ts +++ b/packages/vscode/src/client.ts @@ -30,6 +30,15 @@ export class Client extends IdeClient { private readonly windowId = parseInt(new Date().toISOString().replace(/[-:.TZ]/g, ""), 10); private _serviceCollection: ServiceCollection | undefined; private _clipboardContextKey: RawContextKey | undefined; + private _builtInExtensionsDirectory: string | undefined; + + public get builtInExtensionsDirectory(): string { + if (!this._builtInExtensionsDirectory) { + throw new Error("trying to access builtin extensions directory before it has been set"); + } + + return this._builtInExtensionsDirectory; + } public async handleExternalDrop(target: ExplorerItem | Model, originalEvent: DragMouseEvent): Promise { await this.upload.uploadDropped( @@ -157,6 +166,7 @@ export class Client extends IdeClient { return this.task("Start workbench", 1000, async (data) => { paths._paths.appData = data.dataDirectory; paths._paths.defaultUserData = data.dataDirectory; + this._builtInExtensionsDirectory = data.builtInExtensionsDirectory; process.env.SHELL = data.shell; const { startup } = require("./startup"); diff --git a/scripts/vscode.patch b/scripts/vscode.patch index baa56223a..4ae3e493d 100644 --- a/scripts/vscode.patch +++ b/scripts/vscode.patch @@ -328,6 +328,19 @@ index 7b4e8721ac..96d612f940 100644 } return codeEditorModel; +diff --git a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts +index 4cb7a231f3..d5a9c26673 100644 +--- a/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts ++++ b/src/vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts +@@ -31,6 +31,8 @@ interface IExtensionCacheData { + + let _SystemExtensionsRoot: string | null = null; + function getSystemExtensionsRoot(): string { ++ const { client } = require("../../../../../../../../packages/vscode") as typeof import ("../../../../../../../../packages/vscode"); ++ return client.builtInExtensionsDirectory; + if (!_SystemExtensionsRoot) { + _SystemExtensionsRoot = path.normalize(path.join(getPathFromAmdModule(require, ''), '..', 'extensions')); + } diff --git a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts b/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts index 5b4136989f..25ccc0fe9e 100644 --- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts