forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontracts.ts
More file actions
57 lines (47 loc) · 1.97 KB
/
contracts.ts
File metadata and controls
57 lines (47 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { ConfigurationTarget, Disposable, Uri } from 'vscode';
import { Architecture } from '../common/platform/types';
export const INTERPRETER_LOCATOR_SERVICE = 'IInterpreterLocatorService';
export const WINDOWS_REGISTRY_SERVICE = 'WindowsRegistryService';
export const CONDA_ENV_FILE_SERVICE = 'CondaEnvFileService';
export const CONDA_ENV_SERVICE = 'CondaEnvService';
export const CURRENT_PATH_SERVICE = 'CurrentPathService';
export const KNOWN_PATH_SERVICE = 'KnownPathsService';
export const VIRTUAL_ENV_SERVICE = 'VirtualEnvService';
export const IInterpreterVersionService = Symbol('IInterpreterVersionService');
export interface IInterpreterVersionService {
getVersion(pythonPath: string, defaultValue: string): Promise<string>;
getPipVersion(pythonPath: string): Promise<string>;
}
export const ICondaEnvironmentFile = Symbol('ICondaEnvironmentFile');
export const IKnownSearchPathsForInterpreters = Symbol('IKnownSearchPathsForInterpreters');
export const IKnownSearchPathsForVirtualEnvironments = Symbol('IKnownSearchPathsForVirtualEnvironments');
export const IInterpreterLocatorService = Symbol('IInterpreterLocatorService');
export interface IInterpreterLocatorService extends Disposable {
getInterpreters(resource?: Uri): Promise<PythonInterpreter[]>;
}
export const ICondaLocatorService = Symbol('ICondaLocatorService');
export interface ICondaLocatorService {
getCondaFile(): Promise<string>;
isCondaAvailable(): Promise<boolean>;
getCondaVersion(): Promise<string | undefined>;
}
export enum InterpreterType {
Unknown = 1,
Conda = 2,
VirtualEnv = 4,
VEnv = 8
}
export type PythonInterpreter = {
path: string;
companyDisplayName?: string;
displayName?: string;
version?: string;
architecture?: Architecture;
type: InterpreterType;
envName?: string;
};
export type WorkspacePythonPath = {
folderUri: Uri;
pytonPath?: string;
configTarget: ConfigurationTarget.Workspace | ConfigurationTarget.WorkspaceFolder;
};