@@ -16,7 +16,13 @@ import {
1616 ResolveEnvironmentContext ,
1717 SetEnvironmentScope ,
1818} from '../../api' ;
19- import { Capabilities , EnvironmentManagerCapability , supportedCapability , EnvironmentCapability } from '../../capabilities' ;
19+ import {
20+ Capabilities ,
21+ EnvironmentCapability ,
22+ EnvironmentManagerCapability ,
23+ supportedCapability ,
24+ } from '../../capabilities' ;
25+ import { PIPENV_MANAGER_ID , DEFAULT_PACKAGE_MANAGER_ID } from '../../common/constants' ;
2026import { PipenvStrings } from '../../common/localize' ;
2127import { traceError , traceInfo } from '../../common/logging' ;
2228import { StopWatch } from '../../common/stopWatch' ;
@@ -28,14 +34,14 @@ import { normalizePath } from '../../common/utils/pathUtils';
2834import { withProgress } from '../../common/window.apis' ;
2935import { getConfiguration } from '../../common/workspace.apis' ;
3036import type { PythonProjectManager } from '../../features/projectManager' ;
31- import { getProjectFsPathForScope , tryFastPathGet } from '../common/fastPath' ;
32- import { NativePythonEnvironmentKind , NativePythonFinder } from '../common/nativePythonFinder' ;
33- import { notifyMissingManagerIfDefault } from '../common/utils' ;
3437import {
3538 EnvironmentToolSupport ,
3639 pythonToolSupport ,
3740 resolveToolProjectEnvironment ,
3841} from '../../internal/pythonToolSupport' ;
42+ import { getProjectFsPathForScope , tryFastPathGet } from '../common/fastPath' ;
43+ import { NativePythonEnvironmentKind , NativePythonFinder } from '../common/nativePythonFinder' ;
44+ import { notifyMissingManagerIfDefault } from '../common/utils' ;
3945import {
4046 clearPipenvCache ,
4147 getPipenv ,
@@ -91,7 +97,7 @@ export class PipenvManager implements EnvironmentManager, Disposable {
9197 ) {
9298 this . name = 'pipenv' ;
9399 this . displayName = 'Pipenv' ;
94- this . preferredPackageManagerId = 'ms-python.python:pip' ;
100+ this . preferredPackageManagerId = DEFAULT_PACKAGE_MANAGER_ID ;
95101 this . tooltip = new MarkdownString ( PipenvStrings . pipenvManager , true ) ;
96102 }
97103
@@ -161,7 +167,7 @@ export class PipenvManager implements EnvironmentManager, Disposable {
161167 if ( toolSource === 'none' ) {
162168 result = 'tool_not_found' ;
163169 if ( this . projectManager ) {
164- await notifyMissingManagerIfDefault ( 'ms-python.python:pipenv' , this . projectManager , this . api ) ;
170+ await notifyMissingManagerIfDefault ( PIPENV_MANAGER_ID , this . projectManager , this . api ) ;
165171 }
166172 }
167173 } catch ( ex ) {
@@ -369,18 +375,20 @@ export class PipenvManager implements EnvironmentManager, Disposable {
369375 }
370376
371377 async get ( scope : GetEnvironmentScope , toolExecution = false ) : Promise < PythonEnvironment | undefined > {
372- const fastResult = toolExecution ? undefined : await tryFastPathGet ( {
373- initialized : this . _initialized ,
374- setInitialized : ( deferred ) => {
375- this . _initialized = deferred ;
376- } ,
377- scope,
378- label : 'pipenv' ,
379- getProjectFsPath : ( s ) => getProjectFsPathForScope ( this . api , s ) ,
380- getPersistedPath : ( fsPath ) => getPipenvForWorkspace ( fsPath ) ,
381- resolve : ( p ) => resolvePipenvPath ( p , this . nativeFinder , this . api , this ) ,
382- startBackgroundInit : ( ) => this . initializeDiscovery ( ) ,
383- } ) ;
378+ const fastResult = toolExecution
379+ ? undefined
380+ : await tryFastPathGet ( {
381+ initialized : this . _initialized ,
382+ setInitialized : ( deferred ) => {
383+ this . _initialized = deferred ;
384+ } ,
385+ scope,
386+ label : 'pipenv' ,
387+ getProjectFsPath : ( s ) => getProjectFsPathForScope ( this . api , s ) ,
388+ getPersistedPath : ( fsPath ) => getPipenvForWorkspace ( fsPath ) ,
389+ resolve : ( p ) => resolvePipenvPath ( p , this . nativeFinder , this . api , this ) ,
390+ startBackgroundInit : ( ) => this . initializeDiscovery ( ) ,
391+ } ) ;
384392 if ( fastResult ) {
385393 return fastResult . env ;
386394 }
0 commit comments