@@ -9,6 +9,7 @@ import { decimal, integer } from "vscode-languageclient";
99import * as os from 'os' ;
1010import { stringify } from "querystring" ;
1111import { SpanInfo } from "../views/codeAnalytics/InsightListView/CommonInsightObjects" ;
12+ import { WorkspaceState } from "../state" ;
1213
1314
1415export enum Impact
@@ -324,6 +325,9 @@ export interface CodeObjectErrorDetails extends CodeObjectErrorResponse{
324325
325326export class AnalyticsProvider
326327{
328+ public constructor ( private state : WorkspaceState ) {
329+
330+ }
327331 public async getEnvironments ( ) : Promise < string [ ] >
328332 {
329333 try
@@ -351,7 +355,7 @@ export class AnalyticsProvider
351355
352356 public async getCodeObjectsErrors ( codeObjectIds : string [ ] ) : Promise < CodeObjectErrorResponse [ ] >
353357 {
354- let params : [ string , any ] [ ] = [ [ "environment" , Settings . environment . value ] ] ;
358+ let params : [ string , any ] [ ] = [ [ "environment" , this . state . environment ] ] ;
355359 codeObjectIds . forEach ( o => params . push ( [ "codeObjectId" , o ] ) ) ;
356360
357361 const response = await this . send < CodeObjectErrorResponse [ ] > (
@@ -421,7 +425,7 @@ export class AnalyticsProvider
421425 `/CodeAnalytics/insights` ,
422426 undefined ,
423427 {
424- environment : Settings . environment . value
428+ environment : this . state . environment
425429 } ) ;
426430 return response ;
427431 }
@@ -435,7 +439,7 @@ export class AnalyticsProvider
435439 undefined ,
436440 {
437441 codeObjectIds : codeObjectIds ,
438- environment : Settings . environment . value
442+ environment : this . state . environment
439443 } ) ;
440444 return response ;
441445 }
@@ -448,7 +452,7 @@ export class AnalyticsProvider
448452 'POST' ,
449453 `/CodeAnalytics/summary` ,
450454 undefined ,
451- { codeObjectIds : symbolsIdentifiers , environment : Settings . environment . value } ) ;
455+ { codeObjectIds : symbolsIdentifiers , environment : this . state . environment } ) ;
452456
453457 return response ;
454458 }
@@ -462,7 +466,7 @@ export class AnalyticsProvider
462466 {
463467 try
464468 {
465- let params : [ string , any ] [ ] = [ [ "environment" , Settings . environment . value ] ] ;
469+ let params : [ string , any ] [ ] = [ [ "environment" , this . state . environment ] ] ;
466470
467471 if ( sort ) {
468472 params . push ( [ "sort" , sort ] ) ;
@@ -494,7 +498,7 @@ export class AnalyticsProvider
494498 'POST' ,
495499 `/CodeAnalytics/errorFlow` ,
496500 undefined ,
497- { id : errorFlowId , environment : Settings . environment . value } ) ;
501+ { id : errorFlowId , environment : this . state . environment } ) ;
498502
499503 return response ;
500504 }
0 commit comments