Pass builtin extension dir to vscode

This commit is contained in:
Asher 2019-02-06 11:01:15 -06:00
parent 91bd6775c3
commit ddf96077a3
No known key found for this signature in database
GPG Key ID: 7BB4BA9C783D2BBC
2 changed files with 23 additions and 0 deletions

View File

@ -30,6 +30,15 @@ export class Client extends IdeClient {
private readonly windowId = parseInt(new Date().toISOString().replace(/[-:.TZ]/g, ""), 10); private readonly windowId = parseInt(new Date().toISOString().replace(/[-:.TZ]/g, ""), 10);
private _serviceCollection: ServiceCollection | undefined; private _serviceCollection: ServiceCollection | undefined;
private _clipboardContextKey: RawContextKey<boolean> | undefined; private _clipboardContextKey: RawContextKey<boolean> | 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<void> { public async handleExternalDrop(target: ExplorerItem | Model, originalEvent: DragMouseEvent): Promise<void> {
await this.upload.uploadDropped( await this.upload.uploadDropped(
@ -157,6 +166,7 @@ export class Client extends IdeClient {
return this.task("Start workbench", 1000, async (data) => { return this.task("Start workbench", 1000, async (data) => {
paths._paths.appData = data.dataDirectory; paths._paths.appData = data.dataDirectory;
paths._paths.defaultUserData = data.dataDirectory; paths._paths.defaultUserData = data.dataDirectory;
this._builtInExtensionsDirectory = data.builtInExtensionsDirectory;
process.env.SHELL = data.shell; process.env.SHELL = data.shell;
const { startup } = require("./startup"); const { startup } = require("./startup");

View File

@ -328,6 +328,19 @@ index 7b4e8721ac..96d612f940 100644
} }
return codeEditorModel; 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 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 index 5b4136989f..25ccc0fe9e 100644
--- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts --- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts