productService.ts 1.7 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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
/*---------------------------------------------------------------------------------------------
 *  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'; }

	get commit(): string | undefined { return undefined; }

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

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

	get extensionAllowedProposedApi(): string[] { return this.productConfiguration ? this.productConfiguration.extensionAllowedProposedApi : []; }

	get uiExtensions(): string[] | undefined { return this.productConfiguration ? this.productConfiguration.uiExtensions : undefined; }

	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; }
}