@@ -57,9 +57,7 @@ type EnvironmentDetailsByProvider = Partial<EnvironmentDetails> &
57
57
Pick < EnvironmentDetails , 'executable' > &
58
58
Pick < EnvironmentDetails , 'environment' > ;
59
59
60
- export type IInternalEnvironmentProvider =
61
- | ( ILocatorFactoryAPI & IInternalResolverAPI & IInternalIdentifierAPI )
62
- | ( ILocatorFactoryAPI & IInternalResolverAPI ) ;
60
+ export type IInternalEnvironmentProvider = ILocatorFactoryAPI & IInternalResolverAPI ;
63
61
64
62
interface ILocatorFactoryAPI {
65
63
/**
@@ -72,11 +70,13 @@ export type ProposedDetailsAPI = (env: BaseEnvInfo) => Promise<EnvironmentDetail
72
70
export type InternalDetailsAPI = ( env : BasicEnvInfo ) => Promise < PythonEnvInfo | undefined > ;
73
71
export interface IResolverAPI {
74
72
/**
75
- * Carries API to check if an environment can be recognized by the provider. Providers
76
- * which returns details about an {@link EnvSource} are expected to
77
- * provide this.
73
+ * Environment source the provider identifies/resolves.
78
74
*/
79
- readonly sourceIdentifier : IIdentifierAPI | undefined ;
75
+ readonly envSource : EnvSource | undefined ;
76
+ /**
77
+ * Returns true if provided environment is recognized by the provider.
78
+ */
79
+ canIdentifyEnvironment : ( path : UniquePathType ) => Promise < boolean > ;
80
80
/**
81
81
* Returns details or `undefined` if it was found if env is invalid.
82
82
* This is only called if:
@@ -86,28 +86,10 @@ export interface IResolverAPI {
86
86
getEnvironmentDetails : ProposedDetailsAPI ;
87
87
}
88
88
89
- interface IIdentifierAPI {
90
- /**
91
- * Environment source the provider identifies.
92
- */
93
- readonly envSource : EnvSource ;
94
- /**
95
- * Returns true if provided environment is recognized by the provider.
96
- */
97
- canIdentifyEnvironment : ( path : UniquePathType ) => Promise < boolean > ;
98
- }
99
-
100
89
export interface IInternalResolverAPI {
101
- readonly kindIdentifier : IInternalIdentifierAPI | undefined ;
102
- getEnvironmentDetails : InternalDetailsAPI ;
103
- }
104
-
105
- interface IInternalIdentifierAPI {
106
- readonly envKind : PythonEnvKind ;
107
- /**
108
- * Returns true if provided environment is recognized by the provider.
109
- */
90
+ readonly envKind : PythonEnvKind | undefined ;
110
91
canIdentifyEnvironment : ( path : UniquePathType ) => Promise < boolean > ;
92
+ getEnvironmentDetails : InternalDetailsAPI ;
111
93
}
112
94
113
95
export type ILocatorFactory = IWorkspaceLocatorFactory | INonWorkspaceLocatorFactory ;
0 commit comments