@@ -51,24 +51,15 @@ export class ExperimentationTelemetry implements IExperimentationTelemetry {
51
51
}
52
52
}
53
53
54
- interface ProductConfiguration {
55
- quality ?: 'stable' | 'insider' | 'exploration' ;
56
- }
57
-
58
- async function getProductConfig ( appRoot : string ) : Promise < ProductConfiguration > {
59
- const raw = await vscode . workspace . fs . readFile ( ( vscode . Uri . joinPath ( vscode . Uri . file ( appRoot ) , 'product.json' ) ) ) ;
60
- return JSON . parse ( raw . toString ( ) ) ;
61
- }
62
-
63
- function getTargetPopulation ( product : ProductConfiguration ) : TargetPopulation {
64
- switch ( product . quality ) {
65
- case 'stable' :
54
+ function getTargetPopulation ( ) : TargetPopulation {
55
+ switch ( vscode . env . uriScheme ) {
56
+ case 'vscode' :
66
57
return TargetPopulation . Public ;
67
- case 'insider ' :
58
+ case 'vscode-insiders ' :
68
59
return TargetPopulation . Insiders ;
69
- case 'exploration' :
60
+ case 'vscode- exploration' :
70
61
return TargetPopulation . Internal ;
71
- case undefined :
62
+ case 'code-oss' :
72
63
return TargetPopulation . Team ;
73
64
default :
74
65
return TargetPopulation . Public ;
@@ -78,7 +69,5 @@ function getTargetPopulation(product: ProductConfiguration): TargetPopulation {
78
69
export async function createExperimentationService ( context : vscode . ExtensionContext , telemetry : ExperimentationTelemetry ) : Promise < IExperimentationService > {
79
70
const id = context . extension . id ;
80
71
const version = context . extension . packageJSON . version ;
81
- const product = await getProductConfig ( vscode . env . appRoot ) ;
82
- const targetPopulation = getTargetPopulation ( product ) ;
83
- return getExperimentationService ( id , version , targetPopulation , telemetry , context . globalState ) ;
72
+ return getExperimentationService ( id , version , getTargetPopulation ( ) , telemetry , context . globalState ) ;
84
73
}
0 commit comments