mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
Adding a global Env to the extension API
This commit is contained in:
@@ -39,6 +39,7 @@ import {CancellationTokenSource} from 'vs/base/common/cancellation';
|
||||
import vscode = require('vscode');
|
||||
import {TextEditorRevealType} from 'vs/workbench/api/node/mainThreadEditors';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
/**
|
||||
* This class implements the API described in vscode.d.ts,
|
||||
@@ -54,8 +55,9 @@ export class ExtHostAPIImplementation {
|
||||
private _threadService: IThreadService;
|
||||
private _proxy: MainProcessVSCodeAPIHelper;
|
||||
private _pluginService: IPluginService;
|
||||
private _telemetryService: ITelemetryService;
|
||||
|
||||
version: typeof vscode.version;
|
||||
env: typeof vscode.env;
|
||||
Uri: typeof vscode.Uri;
|
||||
Location: typeof vscode.Location;
|
||||
Diagnostic: typeof vscode.Diagnostic;
|
||||
@@ -92,13 +94,23 @@ export class ExtHostAPIImplementation {
|
||||
constructor(
|
||||
@IThreadService threadService: IThreadService,
|
||||
@IPluginService pluginService: IPluginService,
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService,
|
||||
@ITelemetryService telemetryService: ITelemetryService
|
||||
) {
|
||||
this._pluginService = pluginService;
|
||||
this._threadService = threadService;
|
||||
this._telemetryService = telemetryService;
|
||||
this._proxy = threadService.getRemotable(MainProcessVSCodeAPIHelper);
|
||||
|
||||
this.version = contextService.getConfiguration().env.version;
|
||||
this._telemetryService.getTelemetryInfo().then((info) => {
|
||||
this.env = {
|
||||
version:contextService.getConfiguration().env.version,
|
||||
machineId: info.machineId,
|
||||
sessionId: info.sessionId,
|
||||
locale: null
|
||||
}
|
||||
});
|
||||
|
||||
this.Uri = URI;
|
||||
this.Location = extHostTypes.Location;
|
||||
this.Diagnostic = <any> extHostTypes.Diagnostic;
|
||||
|
||||
Reference in New Issue
Block a user