mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
expose appName in env, fixes #5297
This commit is contained in:
parent
ab8c06cad2
commit
5e7f6d8c92
|
@ -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');
|
||||
});
|
||||
|
|
7
src/vs/vscode.d.ts
vendored
7
src/vs/vscode.d.ts
vendored
|
@ -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`.
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue