don't mention locale for now, make env a namespace and move to namespace region, make sure env exists event in case of telemetry failure

This commit is contained in:
Johannes Rieken
2016-01-22 09:59:25 +01:00
parent 86ecfe849d
commit 0697316d74
2 changed files with 29 additions and 29 deletions

View File

@@ -55,7 +55,6 @@ export class ExtHostAPIImplementation {
private _threadService: IThreadService;
private _proxy: MainProcessVSCodeAPIHelper;
private _pluginService: IPluginService;
private _telemetryService: ITelemetryService;
version: typeof vscode.version;
env: typeof vscode.env;
@@ -100,18 +99,9 @@ export class ExtHostAPIImplementation {
) {
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 = {
machineId: info.machineId,
sessionId: info.sessionId,
locale: null
}
});
this.Uri = URI;
this.Location = extHostTypes.Location;
this.Diagnostic = <any> extHostTypes.Diagnostic;
@@ -151,6 +141,17 @@ export class ExtHostAPIImplementation {
const pluginHostStatusBar = new ExtHostStatusBar(this._threadService);
const extHostOutputService = new ExtHostOutputService(this._threadService);
// env namespace
this.env = {
machineId: undefined,
sessionId: undefined,
// locale: undefined
}
telemetryService.getTelemetryInfo().then(info => {
this.env.machineId = info.machineId;
this.env.sessionId = info.sessionId;
}, errors.onUnexpectedError);
// commands namespace
this.commands = {
registerCommand<T>(id: string, command: <T>(...args: any[]) => T | Thenable<T>, thisArgs?: any): vscode.Disposable {