@@ -47,9 +47,9 @@ export async function clearPipenvCache(): Promise<void> {
4747 pipenvPath = undefined ;
4848}
4949
50- function getPipenvPathFromSettings ( ) : Uri [ ] {
50+ function getPipenvPathFromSettings ( ) : string | undefined {
5151 const pipenvPath = getSettingWorkspaceScope < string > ( 'python' , 'pipenvPath' ) ;
52- return pipenvPath ? [ Uri . file ( pipenvPath ) ] : [ ] ;
52+ return pipenvPath ? pipenvPath : undefined ;
5353}
5454
5555export async function getPipenv ( native ?: NativePythonFinder ) : Promise < string | undefined > {
@@ -64,6 +64,14 @@ export async function getPipenv(native?: NativePythonFinder): Promise<string | u
6464 return pipenvPath ;
6565 }
6666
67+ // try to get from settings
68+ const settingPath = getPipenvPathFromSettings ( ) ;
69+ if ( settingPath ) {
70+ pipenvPath = settingPath ;
71+ traceInfo ( `Using pipenv from settings: ${ settingPath } ` ) ;
72+ return pipenvPath ;
73+ }
74+
6775 // Try to find pipenv in PATH
6876 const foundPipenv = await findPipenv ( ) ;
6977 if ( foundPipenv ) {
@@ -147,8 +155,8 @@ export async function refreshPipenv(
147155) : Promise < PythonEnvironment [ ] > {
148156 traceInfo ( 'Refreshing pipenv environments' ) ;
149157
150- const searchUris = getPipenvPathFromSettings ( ) ;
151- const data = await nativeFinder . refresh ( hardRefresh , searchUris . length > 0 ? searchUris : undefined ) ;
158+ const searchPath = getPipenvPathFromSettings ( ) ;
159+ const data = await nativeFinder . refresh ( hardRefresh , searchPath ? [ Uri . file ( searchPath ) ] : undefined ) ;
152160
153161 let pipenv = await getPipenv ( ) ;
154162
0 commit comments