@@ -359,6 +359,9 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
359
359
nativeCondaEnvDirsNotFound : number ;
360
360
nativeCondaEnvDirsNotFoundHasEnvs : number ;
361
361
nativeCondaEnvDirsNotFoundHasEnvsInTxt : number ;
362
+ nativeCondaEnvTxtSame ?: boolean ;
363
+ nativeCondaEnvTxtExists ?: boolean ;
364
+ nativeCondaEnvsFromTxt : number ;
362
365
} ;
363
366
364
367
const userProvidedCondaExe = fsPath
@@ -380,11 +383,12 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
380
383
nativeCondaEnvDirsNotFound : 0 ,
381
384
nativeCondaEnvDirsNotFoundHasEnvs : 0 ,
382
385
nativeCondaEnvDirsNotFoundHasEnvsInTxt : 0 ,
386
+ nativeCondaEnvsFromTxt : 0 ,
383
387
} ;
384
388
385
389
// Get conda telemetry
386
390
{
387
- const [ info , nativeCondaInfo , condaEnvsInEnvironmentsTxt ] = await Promise . all ( [
391
+ const [ info , nativeCondaInfo , condaEnvsInEnvironmentsTxt , envTxt ] = await Promise . all ( [
388
392
Conda . getConda ( )
389
393
. catch ( ( ex ) => traceError ( 'Failed to get conda info' , ex ) )
390
394
. then ( ( conda ) => conda ?. getInfo ( ) ) ,
@@ -405,12 +409,20 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
405
409
} )
406
410
. catch ( ( ex ) => traceError ( `Failed to get conda envs from environments.txt` , ex ) )
407
411
. then ( ( items ) => items || [ ] ) ,
412
+ getCondaEnvironmentsTxt ( ) . catch ( noop ) ,
408
413
] ) ;
409
414
415
+ const environmentsTxt =
416
+ Array . isArray ( envTxt ) && envTxt . length ? fsPath . normalize ( envTxt [ 0 ] ) . toLowerCase ( ) : undefined ;
410
417
if ( nativeCondaInfo ) {
411
418
condaTelemetry . nativeCanSpawnConda = nativeCondaInfo . canSpawnConda ;
412
419
condaTelemetry . nativeCondaInfoEnvsDirs = new Set ( nativeCondaInfo . envDirs ) . size ;
413
420
condaTelemetry . nativeCondaRcs = new Set ( nativeCondaInfo . condaRcs ) . size ;
421
+
422
+ const nativeEnvTxt = fsPath . normalize ( nativeCondaInfo . environmentsTxt || '' ) . toLowerCase ( ) ;
423
+ condaTelemetry . nativeCondaEnvTxtExists = nativeCondaInfo . environmentsTxtExists === true ;
424
+ condaTelemetry . nativeCondaEnvsFromTxt = ( nativeCondaInfo . environmentsFromTxt || [ ] ) . length ;
425
+ condaTelemetry . nativeCondaEnvTxtSame = nativeEnvTxt === environmentsTxt ;
414
426
}
415
427
condaTelemetry . condaEnvsInTxt = condaEnvsInEnvironmentsTxt . length ;
416
428
condaTelemetry . canSpawnConda = ! ! info ;
@@ -736,7 +748,7 @@ export class EnvsCollectionService extends PythonEnvsWatcher<PythonEnvCollection
736
748
737
749
// Intent is to capture time taken for discovery of all envs to complete the first time.
738
750
sendTelemetryEvent ( EventName . PYTHON_INTERPRETER_DISCOVERY , elapsedTime , {
739
- telVer : 5 ,
751
+ telVer : 6 ,
740
752
nativeDuration,
741
753
workspaceFolderCount : ( workspace . workspaceFolders || [ ] ) . length ,
742
754
interpreters : this . cache . getAllEnvs ( ) . length ,
0 commit comments