1
1
import { SemVer } from 'semver' ;
2
2
import { CodeLensProvider , ConfigurationTarget , Disposable , Event , TextDocument , Uri } from 'vscode' ;
3
- import { IExtensionSingleActivationService } from '../activation/types' ;
4
3
import { FileChangeType } from '../common/platform/fileSystemWatcher' ;
5
4
import { Resource } from '../common/types' ;
6
5
import { PythonEnvSource } from '../pythonEnvironments/base/info' ;
7
6
import { PythonLocatorQuery } from '../pythonEnvironments/base/locator' ;
8
- import { CondaEnvironmentInfo , CondaInfo } from '../pythonEnvironments/common/environmentManagers/conda' ;
7
+ import { CondaEnvironmentInfo } from '../pythonEnvironments/common/environmentManagers/conda' ;
9
8
import { EnvironmentType , PythonEnvironment } from '../pythonEnvironments/info' ;
10
9
11
- export const INTERPRETER_LOCATOR_SERVICE = 'IInterpreterLocatorService' ;
12
- export const WINDOWS_REGISTRY_SERVICE = 'WindowsRegistryService' ;
13
- export const CONDA_ENV_FILE_SERVICE = 'CondaEnvFileService' ;
14
- export const CONDA_ENV_SERVICE = 'CondaEnvService' ;
15
- export const CURRENT_PATH_SERVICE = 'CurrentPathService' ;
16
- export const KNOWN_PATH_SERVICE = 'KnownPathsService' ;
17
- export const GLOBAL_VIRTUAL_ENV_SERVICE = 'VirtualEnvService' ;
18
- export const WORKSPACE_VIRTUAL_ENV_SERVICE = 'WorkspaceVirtualEnvService' ;
19
- export const PIPENV_SERVICE = 'PipEnvService' ;
20
10
export const IInterpreterVersionService = Symbol ( 'IInterpreterVersionService' ) ;
21
11
export interface IInterpreterVersionService {
22
12
getVersion ( pythonPath : string , defaultValue : string ) : Promise < string > ;
23
- getPipVersion ( pythonPath : string ) : Promise < string > ;
24
- }
25
-
26
- export const IKnownSearchPathsForInterpreters = Symbol ( 'IKnownSearchPathsForInterpreters' ) ;
27
- export interface IKnownSearchPathsForInterpreters {
28
- getSearchPaths ( ) : string [ ] ;
29
- }
30
- export const IVirtualEnvironmentsSearchPathProvider = Symbol ( 'IVirtualEnvironmentsSearchPathProvider' ) ;
31
- export interface IVirtualEnvironmentsSearchPathProvider {
32
- getSearchPaths ( resource ?: Uri ) : Promise < string [ ] > ;
33
13
}
34
14
35
15
export type PythonEnvironmentsChangedEvent = {
@@ -74,15 +54,6 @@ export interface IComponentAdapter {
74
54
isWindowsStoreInterpreter ( pythonPath : string ) : Promise < boolean > ;
75
55
}
76
56
77
- export const IInterpreterLocatorService = Symbol ( 'IInterpreterLocatorService' ) ;
78
-
79
- export interface IInterpreterLocatorService extends Disposable {
80
- readonly onLocating : Event < Promise < PythonEnvironment [ ] > > ;
81
- readonly hasInterpreters : Promise < boolean > ;
82
- didTriggerInterpreterSuggestions ?: boolean ;
83
- getInterpreters ( resource ?: Uri , options ?: GetInterpreterOptions ) : Promise < PythonEnvironment [ ] > ;
84
- }
85
-
86
57
export const ICondaService = Symbol ( 'ICondaService' ) ;
87
58
/**
88
59
* Interface carries the properties which are not available via the discovery component interface.
@@ -94,20 +65,6 @@ export interface ICondaService {
94
65
getCondaFileFromInterpreter ( interpreterPath ?: string , envName ?: string ) : Promise < string | undefined > ;
95
66
}
96
67
97
- export const ICondaLocatorService = Symbol ( 'ICondaLocatorService' ) ;
98
- /**
99
- * @deprecated Use the new discovery component when in experiment, use this otherwise.
100
- */
101
- export interface ICondaLocatorService {
102
- readonly condaEnvironmentsFile : string | undefined ;
103
- getCondaFile ( ) : Promise < string > ;
104
- getCondaInfo ( ) : Promise < CondaInfo | undefined > ;
105
- getCondaEnvironments ( ignoreCache : boolean ) : Promise < CondaEnvironmentInfo [ ] | undefined > ;
106
- getInterpreterPath ( condaEnvironmentPath : string ) : string ;
107
- isCondaEnvironment ( interpreterPath : string ) : Promise < boolean > ;
108
- getCondaEnvironment ( interpreterPath : string ) : Promise < CondaEnvironmentInfo | undefined > ;
109
- }
110
-
111
68
export const IInterpreterService = Symbol ( 'IInterpreterService' ) ;
112
69
export interface IInterpreterService {
113
70
readonly onRefreshStart : Event < void > ;
@@ -119,7 +76,7 @@ export interface IInterpreterService {
119
76
onDidChangeInterpreterInformation : Event < PythonEnvironment > ;
120
77
hasInterpreters ( filter ?: ( e : PythonEnvironment ) => Promise < boolean > ) : Promise < boolean > ;
121
78
getInterpreters ( resource ?: Uri ) : PythonEnvironment [ ] ;
122
- getAllInterpreters ( resource ?: Uri , options ?: GetInterpreterOptions ) : Promise < PythonEnvironment [ ] > ;
79
+ getAllInterpreters ( resource ?: Uri ) : Promise < PythonEnvironment [ ] > ;
123
80
getActiveInterpreter ( resource ?: Uri ) : Promise < PythonEnvironment | undefined > ;
124
81
getInterpreterDetails ( pythonPath : string , resoure ?: Uri ) : Promise < undefined | PythonEnvironment > ;
125
82
refresh ( resource : Resource ) : Promise < void > ;
@@ -146,33 +103,6 @@ export interface IInterpreterHelper {
146
103
getBestInterpreter ( interpreters ?: PythonEnvironment [ ] ) : PythonEnvironment | undefined ;
147
104
}
148
105
149
- export const IPipEnvService = Symbol ( 'IPipEnvService' ) ;
150
- export interface IPipEnvService extends IInterpreterLocatorService {
151
- executable : string ;
152
- isRelatedPipEnvironment ( dir : string , pythonPath : string ) : Promise < boolean > ;
153
- }
154
-
155
- export const IInterpreterLocatorHelper = Symbol ( 'IInterpreterLocatorHelper' ) ;
156
- export interface IInterpreterLocatorHelper {
157
- mergeInterpreters ( interpreters : PythonEnvironment [ ] ) : Promise < PythonEnvironment [ ] > ;
158
- }
159
-
160
- export const IInterpreterWatcher = Symbol ( 'IInterpreterWatcher' ) ;
161
- export interface IInterpreterWatcher {
162
- onDidCreate : Event < Resource > ;
163
- }
164
-
165
- export const IInterpreterWatcherBuilder = Symbol ( 'IInterpreterWatcherBuilder' ) ;
166
- export interface IInterpreterWatcherBuilder {
167
- getWorkspaceVirtualEnvInterpreterWatcher ( resource : Resource ) : Promise < IInterpreterWatcher > ;
168
- }
169
-
170
- export const IInterpreterLocatorProgressService = Symbol ( 'IInterpreterLocatorProgressService' ) ;
171
- export interface IInterpreterLocatorProgressService extends IExtensionSingleActivationService {
172
- readonly onRefreshing : Event < void > ;
173
- readonly onRefreshed : Event < void > ;
174
- }
175
-
176
106
export const IInterpreterStatusbarVisibilityFilter = Symbol ( 'IInterpreterStatusbarVisibilityFilter' ) ;
177
107
/**
178
108
* Implement this interface to control the visibility of the interpreter statusbar.
@@ -186,5 +116,3 @@ export type WorkspacePythonPath = {
186
116
folderUri : Uri ;
187
117
configTarget : ConfigurationTarget . Workspace | ConfigurationTarget . WorkspaceFolder ;
188
118
} ;
189
-
190
- export type GetInterpreterOptions = { ignoreCache ?: boolean ; onSuggestion ?: boolean } ;
0 commit comments