@@ -115,25 +115,6 @@ type VersionInfo = {
115
115
export interface EnvironmentDetails {
116
116
executable : {
117
117
path : string ;
118
- run : {
119
- // Functions would only require the arguments. The env provider can internally decide on the commands.
120
- // Support option of whether to run as a process or VSCode terminal.
121
- // However note we cannot pass this into the debugger at the moment, as VSCode itself handles execution.
122
- // Gotta add support in VSCode for that, they already support that for LSP.
123
- // TODO: Gotta support this for upstream debugger
124
- exec : Function ;
125
- shellExec : Function ; // Only for backwards compatibility.
126
- execObservable : Function ;
127
- /**
128
- * Uses a VSCode terminal.
129
- * */
130
- terminalExec : ( ) => void ;
131
- /**
132
- * Any environment variables that can be used to activate the environment, if supported.
133
- * If not provided, Python extension itself uses the other execution APIs to calculate it.
134
- */
135
- env ?: { [ key : string ] : string | null | undefined } ;
136
- } ;
137
118
bitness ?: Architecture ;
138
119
sysPrefix : string ;
139
120
} ;
@@ -164,10 +145,15 @@ type EnvironmentDetailsByProvider = Partial<EnvironmentDetails> & Pick<Environme
164
145
165
146
interface IEnvironmentProvider {
166
147
createLocator : ILocatorFactory ;
167
- getEnvironmentDetails : ( env : EnvInfo ) => Promise < EnvironmentDetailsByProvider | undefined > ;
148
+ canIdentifyEnvironment : ( env : BaseEnvInfo ) => Promise < boolean > ;
149
+ /**
150
+ * This is only called if this provider can identify the environment.
151
+ * Returns details or `undefined` if it was found if env is invalid.
152
+ */
153
+ getEnvironmentDetails : ( env : BaseEnvInfo ) => Promise < EnvironmentDetailsByProvider | undefined > ;
168
154
}
169
155
170
- export type ILocatorFactory = INonWorkspaceLocatorFactory | IWorkspaceLocatorFactory ;
156
+ export type ILocatorFactory = IWorkspaceLocatorFactory | INonWorkspaceLocatorFactory ;
171
157
export type INonWorkspaceLocatorFactory = ( ) => ILocatorAPI ;
172
158
export type IWorkspaceLocatorFactory = ( root : string ) => ILocatorAPI ;
173
159
@@ -176,8 +162,11 @@ export interface ILocatorAPI {
176
162
readonly onChanged ?: Event < LocatorEnvsChangedEvent > ;
177
163
}
178
164
179
- export type EnvInfo = {
165
+ export type EnvInfo = BaseEnvInfo & {
180
166
envSources : EnvSource [ ] ;
167
+ } ;
168
+
169
+ export type BaseEnvInfo = {
181
170
executablePath : string ;
182
171
envPath ?: string ;
183
172
} ;
0 commit comments