Pass product configuration
This commit is contained in:
parent
2e77c9d449
commit
4685f6793d
|
@ -13,6 +13,7 @@ import { IEnvironmentService } from "vs/platform/environment/common/environment"
|
||||||
import { IExtensionDescription, ExtensionIdentifier } from "vs/platform/extensions/common/extensions";
|
import { IExtensionDescription, ExtensionIdentifier } from "vs/platform/extensions/common/extensions";
|
||||||
import { FileDeleteOptions, FileOverwriteOptions, FileType, IStat, IWatchOptions, FileOpenOptions } from "vs/platform/files/common/files";
|
import { FileDeleteOptions, FileOverwriteOptions, FileType, IStat, IWatchOptions, FileOpenOptions } from "vs/platform/files/common/files";
|
||||||
import { ILogService } from "vs/platform/log/common/log";
|
import { ILogService } from "vs/platform/log/common/log";
|
||||||
|
import { IProductService } from "vs/platform/product/common/product";
|
||||||
import { IRemoteAgentEnvironment } from "vs/platform/remote/common/remoteAgentEnvironment";
|
import { IRemoteAgentEnvironment } from "vs/platform/remote/common/remoteAgentEnvironment";
|
||||||
import { ExtensionScanner, ExtensionScannerInput } from "vs/workbench/services/extensions/node/extensionPoints";
|
import { ExtensionScanner, ExtensionScannerInput } from "vs/workbench/services/extensions/node/extensionPoints";
|
||||||
import { DiskFileSystemProvider } from "vs/workbench/services/files/node/diskFileSystemProvider";
|
import { DiskFileSystemProvider } from "vs/workbench/services/files/node/diskFileSystemProvider";
|
||||||
|
@ -199,14 +200,14 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
|
||||||
|
|
||||||
private async scanExtensions(locale: string): Promise<IExtensionDescription[]> {
|
private async scanExtensions(locale: string): Promise<IExtensionDescription[]> {
|
||||||
const root = getPathFromAmdModule(require, "");
|
const root = getPathFromAmdModule(require, "");
|
||||||
const pkg = require.__$__nodeRequire(path.resolve(root, "../package.json")) as any;
|
const product = require.__$__nodeRequire(path.resolve(root, "../package.json")) as IProductService;
|
||||||
|
|
||||||
const translations = {}; // TODO: translations
|
const translations = {}; // TODO: translations
|
||||||
|
|
||||||
// TODO: there is also this.environment.extensionDevelopmentLocationURI to look into.
|
// TODO: there is also this.environment.extensionDevelopmentLocationURI to look into.
|
||||||
const scanBuiltin = async (): Promise<IExtensionDescription[]> => {
|
const scanBuiltin = async (): Promise<IExtensionDescription[]> => {
|
||||||
const input = new ExtensionScannerInput(
|
const input = new ExtensionScannerInput(
|
||||||
pkg.version, pkg.commit, locale, !!process.env.VSCODE_DEV,
|
product.version, product.commit, locale, !!process.env.VSCODE_DEV,
|
||||||
path.resolve(root, "../extensions"),
|
path.resolve(root, "../extensions"),
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
|
@ -219,7 +220,7 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
|
||||||
|
|
||||||
const scanInstalled = async (): Promise<IExtensionDescription[]> => {
|
const scanInstalled = async (): Promise<IExtensionDescription[]> => {
|
||||||
const input = new ExtensionScannerInput(
|
const input = new ExtensionScannerInput(
|
||||||
pkg.version, pkg.commit, locale, !!process.env.VSCODE_DEV,
|
product.version, product.commit, locale, !!process.env.VSCODE_DEV,
|
||||||
this.environment.extensionsPath, false, true, translations,
|
this.environment.extensionsPath, false, true, translations,
|
||||||
);
|
);
|
||||||
return ExtensionScanner.scanExtensions(input, this.log);
|
return ExtensionScanner.scanExtensions(input, this.log);
|
||||||
|
|
|
@ -5,6 +5,7 @@ import * as path from "path";
|
||||||
import * as util from "util";
|
import * as util from "util";
|
||||||
import * as url from "url";
|
import * as url from "url";
|
||||||
|
|
||||||
|
import { getPathFromAmdModule } from "vs/base/common/amd";
|
||||||
import { Emitter } from "vs/base/common/event";
|
import { Emitter } from "vs/base/common/event";
|
||||||
import { sanitizeFilePath } from "vs/base/common/extpath";
|
import { sanitizeFilePath } from "vs/base/common/extpath";
|
||||||
import { getMediaMime } from "vs/base/common/mime";
|
import { getMediaMime } from "vs/base/common/mime";
|
||||||
|
@ -164,7 +165,7 @@ export class Server {
|
||||||
remoteAuthority,
|
remoteAuthority,
|
||||||
},
|
},
|
||||||
REMOTE_USER_DATA_URI: transformer.transformOutgoing(this.environmentService.webUserDataHome),
|
REMOTE_USER_DATA_URI: transformer.transformOutgoing(this.environmentService.webUserDataHome),
|
||||||
PRODUCT_CONFIGURATION: null,
|
PRODUCT_CONFIGURATION: require.__$__nodeRequire(path.resolve(getPathFromAmdModule(require, ""), "../product.json")),
|
||||||
CONNECTION_AUTH_TOKEN: "",
|
CONNECTION_AUTH_TOKEN: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue