File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ export class InterpreterManager implements Disposable {
47
47
const interpreters = await this . interpreterProvider . getInterpreters ( activeWorkspace . folderUri ) ;
48
48
const workspacePathUpper = activeWorkspace . folderUri . fsPath . toUpperCase ( ) ;
49
49
const interpretersInWorkspace = interpreters . filter ( interpreter => interpreter . path . toUpperCase ( ) . startsWith ( workspacePathUpper ) ) ;
50
- if ( interpretersInWorkspace . length !== 1 ) {
50
+ // Always pick the first available one.
51
+ if ( interpretersInWorkspace . length === 0 ) {
51
52
return ;
52
53
}
53
54
@@ -73,6 +74,10 @@ export class InterpreterManager implements Disposable {
73
74
}
74
75
const pythonConfig = workspace . getConfiguration ( 'python' , activeWorkspace . folderUri ) ;
75
76
const pythonPathInConfig = pythonConfig . inspect < string > ( 'pythonPath' ) ;
77
+ // If we have a value in user settings, then don't auto set the interpreter path.
78
+ if ( pythonPathInConfig && pythonPathInConfig ! . globalValue !== undefined && pythonPathInConfig ! . globalValue !== 'python' ) {
79
+ return false ;
80
+ }
76
81
if ( activeWorkspace . configTarget === ConfigurationTarget . Workspace ) {
77
82
return pythonPathInConfig . workspaceValue === undefined || pythonPathInConfig . workspaceValue === 'python' ;
78
83
}
You can’t perform that action at this time.
0 commit comments