File tree 2 files changed +8
-2
lines changed
src/client/pythonEnvironments/base/locators 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,10 @@ function getCustomVirtualEnvDirs(): string[] {
422
422
const venvFolders = getPythonSettingAndUntildify < string [ ] > ( VENVFOLDERS_SETTING_KEY ) ?? [ ] ;
423
423
const homeDir = getUserHomeDir ( ) ;
424
424
if ( homeDir ) {
425
- venvFolders . map ( ( item ) => path . join ( homeDir , item ) ) . forEach ( ( d ) => venvDirs . push ( d ) ) ;
425
+ venvFolders
426
+ . map ( ( item ) => ( item . startsWith ( homeDir ) ? item : path . join ( homeDir , item ) ) )
427
+ . forEach ( ( d ) => venvDirs . push ( d ) ) ;
428
+ venvFolders . forEach ( ( item ) => venvDirs . push ( untildify ( item ) ) ) ;
426
429
}
427
430
return Array . from ( new Set ( venvDirs ) ) ;
428
431
}
Original file line number Diff line number Diff line change @@ -41,7 +41,10 @@ async function getCustomVirtualEnvDirs(): Promise<string[]> {
41
41
const venvFolders = getPythonSetting < string [ ] > ( VENVFOLDERS_SETTING_KEY ) ?? [ ] ;
42
42
const homeDir = getUserHomeDir ( ) ;
43
43
if ( homeDir && ( await pathExists ( homeDir ) ) ) {
44
- venvFolders . map ( ( item ) => path . join ( homeDir , item ) ) . forEach ( ( d ) => venvDirs . push ( d ) ) ;
44
+ venvFolders
45
+ . map ( ( item ) => ( item . startsWith ( homeDir ) ? item : path . join ( homeDir , item ) ) )
46
+ . forEach ( ( d ) => venvDirs . push ( d ) ) ;
47
+ venvFolders . forEach ( ( item ) => venvDirs . push ( untildify ( item ) ) ) ;
45
48
}
46
49
return asyncFilter ( uniq ( venvDirs ) , pathExists ) ;
47
50
}
You can’t perform that action at this time.
0 commit comments