diff --git a/extensions/vscode-api-tests/src/env.test.ts b/extensions/vscode-api-tests/src/env.test.ts index 0959c8cead93a4535534ca369aa36f8c55bd42fc..657b559b5d258cc9e48824d8d6d52de25d083923 100644 --- a/extensions/vscode-api-tests/src/env.test.ts +++ b/extensions/vscode-api-tests/src/env.test.ts @@ -12,12 +12,14 @@ suite('env-namespace', () => { test('env is set', function() { assert.equal(typeof env.language, 'string'); + assert.equal(typeof env.appName, 'string'); assert.equal(typeof env.machineId, 'string'); assert.equal(typeof env.sessionId, 'string'); }); test('env is readonly', function() { assert.throws(() => env.language = '234'); + assert.throws(() => env.appName = '234'); assert.throws(() => env.machineId = '234'); assert.throws(() => env.sessionId = '234'); }); diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index f65ac67814763197630bfc857337e731b84ce1ce..495f36230b8f725ab7af805361b48a1d663c05bf 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2815,6 +2815,13 @@ declare namespace vscode { */ export namespace env { + /** + * The application name of the editor, like 'VS Code'. + * + * @readonly + */ + export let appName: string; + /** * Represents the preferred user-language, like `de-CH`, `fr`, or `en-US`. * diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 55bdfe5014f2d73bad7e481f587eff4ae9189412..828d952e33bd2d4ad510bb3d704a0e0f8a550152 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -158,7 +158,8 @@ export class ExtHostAPIImplementation { this.env = Object.freeze({ get machineId() { return telemetryInfo.machineId; }, get sessionId() { return telemetryInfo.sessionId; }, - get language() { return Platform.language; } + get language() { return Platform.language; }, + get appName() { return contextService.getConfiguration().env.appName; } }); telemetryService.getTelemetryInfo().then(info => telemetryInfo = info, errors.onUnexpectedError);