@@ -14,6 +14,7 @@ import { EXTENSION_ROOT_DIR } from '../../../constants';
1414import { IInterpreterService } from '../../../interpreter/contracts' ;
1515import { Commands } from '../../constants' ;
1616import { IConfigurationService , IPythonSettings } from '../../types' ;
17+ import { getConfiguration } from '../../vscodeApis/workspaceApis' ;
1718import { sendTelemetryEvent } from '../../../telemetry' ;
1819import { EventName } from '../../../telemetry/constants' ;
1920import { EnvironmentType } from '../../../pythonEnvironments/info' ;
@@ -102,6 +103,9 @@ export class ReportIssueCommandHandler implements IExtensionSingleActivationServ
102103 ? `Multiroot scenario, following user settings may not apply:${ os . EOL } `
103104 : '' ;
104105
106+ // Get useEnvironmentsExtension value and indicate if it's user-configured
107+ const useEnvExtensionValue = this . getUseEnvironmentsExtensionInfo ( ) ;
108+
105109 const installedExtensions = getExtensions ( )
106110 . filter ( ( extension ) => ! extension . id . startsWith ( 'vscode.' ) )
107111 . sort ( ( a , b ) => {
@@ -128,6 +132,7 @@ export class ReportIssueCommandHandler implements IExtensionSingleActivationServ
128132 hasMultipleFoldersText ,
129133 userSettings ,
130134 installedExtensions . join ( '\n' ) ,
135+ useEnvExtensionValue ,
131136 ) ,
132137 } ) ;
133138 sendTelemetryEvent ( EventName . USE_REPORT_ISSUE_COMMAND , undefined , { } ) ;
@@ -141,4 +146,25 @@ export class ReportIssueCommandHandler implements IExtensionSingleActivationServ
141146 const systemVariables = new SystemVariables ( resource , undefined , this . workspaceService ) ;
142147 return systemVariables . resolveAny ( this . packageJSONSettings [ `python.${ settingKey } ` ] ?. default ) ;
143148 }
149+
150+ private getUseEnvironmentsExtensionInfo ( ) : string {
151+ const config = getConfiguration ( 'python' ) ;
152+ const value = config . get < boolean > ( 'useEnvironmentsExtension' , false ) ;
153+ const inspection = config . inspect < boolean > ( 'useEnvironmentsExtension' ) ;
154+
155+ // Determine where the setting is configured
156+ let source = 'default' ;
157+ if ( inspection ?. workspaceFolderValue !== undefined ) {
158+ source = 'workspace folder' ;
159+ } else if ( inspection ?. workspaceValue !== undefined ) {
160+ source = 'workspace' ;
161+ } else if ( inspection ?. globalValue !== undefined ) {
162+ source = 'user settings' ;
163+ }
164+
165+ if ( source === 'default' ) {
166+ return `${ value } ` ;
167+ }
168+ return `${ value } (set in ${ source } )` ;
169+ }
144170}
0 commit comments