Summary
The Python extension currently updates the python.defaultInterpreterPath setting in multiple places throughout the codebase. When the Python Environments extension is installed and active (python.useEnvironmentsExtension: true), this creates potential conflicts and unexpected behavior since the Python Environments extension is intended to manage interpreter/environment selection independently.
Current Code Paths That Update defaultInterpreterPath
None of these code paths are currently guarded by useEnvExtension() to check if the Python Environments extension is active.
Deprecation Considerations
If we disable these updates when the Python Environments extension is active, defaultInterpreterPath would no longer be updated by the Python extension in the following scenarios (as these are the situations where it is updated for now)
- VirtualEnvironmentPrompt: When a new virtual environment is detected in the workspace
- ActivatedEnvironmentLaunch: When VS Code is launched from a terminal with an activated conda/venv environment
- Create Environment command: After using the "Create Environment" command
- Extension APIs: When other extensions call
updateActiveEnvironmentPath() or setActiveEnvironment()
Further investigation is needed to understand the full impact on prompting behavior and auto-selection.
Questions
- Do we want the Python extension to be able to edit
defaultInterpreterPath when the Python Environments extension is active?
- Does the Python Environments extension handle all the scenarios listed above?
Summary
The Python extension currently updates the
python.defaultInterpreterPathsetting in multiple places throughout the codebase. When the Python Environments extension is installed and active (python.useEnvironmentsExtension: true), this creates potential conflicts and unexpected behavior since the Python Environments extension is intended to manage interpreter/environment selection independently.Current Code Paths That Update
defaultInterpreterPathInterpreterPathService.update()deprecatedProposedApi.setActiveEnvironment()environmentApi.updateActiveEnvironmentPath()VirtualEnvironmentPromptActivatedEnvironmentLaunchcreateEnvApiNone of these code paths are currently guarded by
useEnvExtension()to check if the Python Environments extension is active.Deprecation Considerations
If we disable these updates when the Python Environments extension is active,
defaultInterpreterPathwould no longer be updated by the Python extension in the following scenarios (as these are the situations where it is updated for now)updateActiveEnvironmentPath()orsetActiveEnvironment()Further investigation is needed to understand the full impact on prompting behavior and auto-selection.
Questions
defaultInterpreterPathwhen the Python Environments extension is active?