Skip to content

Commit

Permalink
Move IComponentAdapter to interpreter/contracts.ts.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently committed Sep 15, 2020
1 parent 3169d36 commit c479940
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
17 changes: 17 additions & 0 deletions src/client/interpreter/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,23 @@ export interface IVirtualEnvironmentsSearchPathProvider {
getSearchPaths(resource?: Uri): Promise<string[]>;
}

export const IComponentAdapter = Symbol('IComponentAdapter');
export interface IComponentAdapter {
// IInterpreterLocatorService
hasInterpreters: Promise<boolean>;
getInterpreters(resource?: Uri, options?: GetInterpreterLocatorOptions): Promise<PythonEnvironment[]>;
// IInterpreterService
getInterpreterDetails(pythonPath: string, _resource?: Uri): Promise<undefined | PythonEnvironment>;
// IInterpreterHelper
getInterpreterInformation(pythonPath: string): Promise<undefined | Partial<PythonEnvironment>>;
isMacDefaultPythonPath(pythonPath: string): Promise<boolean | undefined>;
// ICondaService
isCondaEnvironment(interpreterPath: string): Promise<boolean | undefined>;
getCondaEnvironment(interpreterPath: string): Promise<CondaEnvironmentInfo | undefined>;
// IWindowsStoreInterpreter
isWindowsStoreInterpreter(pythonPath: string): Promise<boolean | undefined>;
}

export const IInterpreterLocatorService = Symbol('IInterpreterLocatorService');

export interface IInterpreterLocatorService extends Disposable {
Expand Down
19 changes: 1 addition & 18 deletions src/client/pythonEnvironments/legacyIOC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
CONDA_ENV_SERVICE,
CURRENT_PATH_SERVICE,
GLOBAL_VIRTUAL_ENV_SERVICE,
IComponentAdapter,
ICondaService,
IInterpreterLocatorHelper,
IInterpreterLocatorProgressService,
Expand Down Expand Up @@ -111,24 +112,6 @@ function convertEnvInfo(info: PythonEnvInfo): PythonEnvironment {
return env;
}

export const IComponentAdapter = Symbol('IComponentAdapter');
export interface IComponentAdapter {
// IInterpreterService
hasInterpreters: Promise<boolean>;
//getInterpreters(_resource?: vscode.Uri, _options?: GetInterpreterOptions): Promise<PythonEnvironment[]>;
getInterpreterDetails(pythonPath: string, _resource?: vscode.Uri): Promise<undefined | PythonEnvironment>;
// IInterpreterLocatorService
getInterpreters(resource?: vscode.Uri, options?: GetInterpreterLocatorOptions): Promise<PythonEnvironment[]>;
// IInterpreterHelper
getInterpreterInformation(pythonPath: string): Promise<undefined | Partial<PythonEnvironment>>;
isMacDefaultPythonPath(pythonPath: string): Promise<boolean | undefined>;
// ICondaService
isCondaEnvironment(interpreterPath: string): Promise<boolean | undefined>;
getCondaEnvironment(interpreterPath: string): Promise<CondaEnvironmentInfo | undefined>;
// IWindowsStoreInterpreter
isWindowsStoreInterpreter(pythonPath: string): Promise<boolean | undefined>;
}

@injectable()
class ComponentAdapter implements IComponentAdapter {
constructor(
Expand Down

0 comments on commit c479940

Please sign in to comment.