@@ -596,15 +596,9 @@ export async function disposeAll(disposables: IDisposable[]): Promise<void> {
596
596
}
597
597
598
598
/**
599
- * Resolves and sets the default Python interpreter for the workspace based on the
600
- * 'python.defaultInterpreterPath' setting and the selected environment manager.
601
- * If the setting is present and no default environment manager is set (or is venv),
602
- * attempts to resolve the interpreter path using the native finder. If the resolved
603
- * path differs from the configured path, then creates and sets a PythonEnvironment
604
- * object for the workspace.
605
- *
606
- * @param nativeFinder - The NativePythonFinder instance used to resolve interpreter paths.
607
- * @param envManagers - The EnvironmentManagers instance containing all registered managers.
599
+ * Sets the default Python interpreter for the workspace if the user has not explicitly set 'defaultEnvManager' or it is set to venv.
600
+ * @param nativeFinder - used to resolve interpreter paths.
601
+ * @param envManagers - contains all registered managers.
608
602
* @param api - The PythonEnvironmentApi for environment resolution and setting.
609
603
*/
610
604
async function resolveDefaultInterpreter (
@@ -615,9 +609,13 @@ async function resolveDefaultInterpreter(
615
609
const defaultInterpreterPath = getConfiguration ( 'python' ) . get < string > ( 'defaultInterpreterPath' ) ;
616
610
617
611
if ( defaultInterpreterPath ) {
618
- const defaultManager = getConfiguration ( 'python-envs' ) . get < string > ( 'defaultEnvManager' , 'undefined' ) ;
619
- traceInfo ( `resolveDefaultInterpreter setting exists; found defaultEnvManager: ${ defaultManager } . ` ) ;
620
- if ( ! defaultManager || defaultManager === 'ms-python.python:venv' ) {
612
+ const config = getConfiguration ( 'python-envs' ) ;
613
+ const inspect = config . inspect < string > ( 'defaultEnvManager' ) ;
614
+ const userDefinedDefaultManager =
615
+ inspect ?. workspaceFolderValue !== undefined ||
616
+ inspect ?. workspaceValue !== undefined ||
617
+ inspect ?. globalValue !== undefined ;
618
+ if ( ! userDefinedDefaultManager ) {
621
619
try {
622
620
const resolved : NativeEnvInfo = await nativeFinder . resolve ( defaultInterpreterPath ) ;
623
621
if ( resolved && resolved . executable ) {
0 commit comments