File tree 2 files changed +9
-7
lines changed
pythonEnvironments/base/locators 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -245,17 +245,19 @@ export interface IProposedExtensionAPI {
245
245
registerEnvironmentProvider (
246
246
environmentProvider : IEnvironmentProvider ,
247
247
metadata : EnvironmentProviderMetadata ,
248
- ) : Promise < void > ;
248
+ ) : Promise < void > ; // TODO: Disposable??
249
249
} ;
250
250
}
251
251
252
252
interface IEnvironmentProvider {
253
- locator : ILocatorClass ;
253
+ // TODO: createEnv
254
+ createLocator : ( root ?: string ) => ILocatorAPI ;
254
255
getEnvironmentDetails : ( env : EnvInfo ) => Promise < EnvironmentDetails | undefined > ;
255
256
}
256
257
257
- export interface ILocatorClass {
258
- new ( root ?: string ) : ILocatorAPI ;
258
+ export interface ILocatorFactory {
259
+ // This should be a function instead.
260
+ createLocator : ( root ?: string ) => ILocatorAPI ;
259
261
}
260
262
261
263
export interface ILocatorAPI {
Original file line number Diff line number Diff line change 3
3
4
4
// eslint-disable-next-line max-classes-per-file
5
5
import { Uri } from 'vscode' ;
6
- import { ILocatorClass } from '../../../apiTypes' ;
6
+ import { ILocatorFactory } from '../../../apiTypes' ;
7
7
import { IDisposable } from '../../../common/types' ;
8
8
import { iterEmpty } from '../../../common/utils/async' ;
9
9
import { getURIFilter } from '../../../common/utils/misc' ;
@@ -37,7 +37,7 @@ export class ExtensionLocators extends Locators<BasicEnvInfo> {
37
37
return combineIterators ( iterators ) ;
38
38
}
39
39
40
- public addNewLocator ( LocatorClass : ILocatorClass , isWorkspace : boolean ) : void {
40
+ public addNewLocator ( LocatorClass : ILocatorFactory , isWorkspace : boolean ) : void {
41
41
if ( isWorkspace ) {
42
42
this . workspace . addNewLocator ( LocatorClass ) ;
43
43
}
@@ -145,7 +145,7 @@ export class WorkspaceLocators extends LazyResourceBasedLocator<BasicEnvInfo> {
145
145
) ;
146
146
}
147
147
148
- public addNewLocator ( LocatorClass : ILocatorClass ) : void {
148
+ public addNewLocator ( LocatorClass : ILocatorFactory ) : void {
149
149
Object . keys ( this . roots ) . forEach ( ( key ) => {
150
150
const root = this . roots [ key ] ;
151
151
const newLocator = new LocatorClass ( root . fsPath ) ;
You can’t perform that action at this time.
0 commit comments