productService.ts 2.6 KB
Newer Older
S
Sandeep Somavarapu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { IProductService, IProductConfiguration } from 'vs/platform/product/common/product';
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';

export class ProductService implements IProductService {

	private readonly productConfiguration: IProductConfiguration | null;

	constructor() {
		const element = document.getElementById('vscode-remote-product-configuration');
		this.productConfiguration = element ? JSON.parse(element.getAttribute('data-settings')!) : null;
	}

	_serviceBrand: ServiceIdentifier<IProductService>;

	get version(): string { return '1.35.0'; }

22
	get commit(): string | undefined { return this.productConfiguration ? this.productConfiguration.commit : undefined; }
S
Sandeep Somavarapu 已提交
23 24 25 26 27

	get nameLong(): string { return ''; }

	get urlProtocol(): string { return ''; }

28
	get extensionAllowedProposedApi(): readonly string[] { return this.productConfiguration ? this.productConfiguration.extensionAllowedProposedApi : []; }
S
Sandeep Somavarapu 已提交
29

30
	get uiExtensions(): readonly string[] | undefined { return this.productConfiguration ? this.productConfiguration.uiExtensions : undefined; }
S
Sandeep Somavarapu 已提交
31 32 33 34 35 36

	get enableTelemetry(): boolean { return false; }

	get sendASmile(): { reportIssueUrl: string, requestFeatureUrl: string } | undefined { return this.productConfiguration ? this.productConfiguration.sendASmile : undefined; }

	get extensionsGallery() { return this.productConfiguration ? this.productConfiguration.extensionsGallery : undefined; }
37 38 39 40

	get settingsSearchBuildId(): number | undefined { return this.productConfiguration ? this.productConfiguration.settingsSearchBuildId : undefined; }

	get settingsSearchUrl(): string | undefined { return this.productConfiguration ? this.productConfiguration.settingsSearchUrl : undefined; }
41 42

	get experimentsUrl(): string | undefined { return this.productConfiguration ? this.productConfiguration.experimentsUrl : undefined; }
43 44

	get extensionKeywords(): { [extension: string]: readonly string[]; } | undefined { return this.productConfiguration ? this.productConfiguration.extensionKeywords : undefined; }
45 46

	get extensionAllowedBadgeProviders(): readonly string[] | undefined { return this.productConfiguration ? this.productConfiguration.extensionAllowedBadgeProviders : undefined; }
47 48

	get aiConfig() { return this.productConfiguration ? this.productConfiguration.aiConfig : undefined; }
S
Sandeep Somavarapu 已提交
49
}