|
4 | 4 | import { Event, Uri } from 'vscode';
|
5 | 5 | import { Resource } from './common/types';
|
6 | 6 | import { IDataViewerDataProvider, IJupyterUriProvider } from './jupyter/types';
|
7 |
| -import { EnvPathType, PythonEnvKind } from './pythonEnvironments/base/info'; |
8 |
| -import { GetRefreshEnvironmentsOptions, ProgressNotificationEvent } from './pythonEnvironments/base/locator'; |
9 | 7 |
|
10 | 8 | /*
|
11 | 9 | * Do not introduce any breaking changes to this API.
|
@@ -88,137 +86,3 @@ export interface IExtensionApi {
|
88 | 86 | registerRemoteServerProvider(serverProvider: IJupyterUriProvider): void;
|
89 | 87 | };
|
90 | 88 | }
|
91 |
| - |
92 |
| -export interface EnvironmentDetailsOptions { |
93 |
| - useCache: boolean; |
94 |
| -} |
95 |
| - |
96 |
| -export interface EnvironmentDetails { |
97 |
| - interpreterPath: string; |
98 |
| - envFolderPath?: string; |
99 |
| - version: string[]; |
100 |
| - environmentType: PythonEnvKind[]; |
101 |
| - metadata: Record<string, unknown>; |
102 |
| -} |
103 |
| - |
104 |
| -export interface EnvironmentsChangedParams { |
105 |
| - /** |
106 |
| - * Path to environment folder or path to interpreter that uniquely identifies an environment. |
107 |
| - * Virtual environments lacking an interpreter are identified by environment folder paths, |
108 |
| - * whereas other envs can be identified using interpreter path. |
109 |
| - */ |
110 |
| - path?: string; |
111 |
| - type: 'add' | 'remove' | 'update' | 'clear-all'; |
112 |
| -} |
113 |
| - |
114 |
| -export interface ActiveEnvironmentChangedParams { |
115 |
| - /** |
116 |
| - * Path to environment folder or path to interpreter that uniquely identifies an environment. |
117 |
| - * Virtual environments lacking an interpreter are identified by environment folder paths, |
118 |
| - * whereas other envs can be identified using interpreter path. |
119 |
| - */ |
120 |
| - path: string; |
121 |
| - resource?: Uri; |
122 |
| -} |
123 |
| - |
124 |
| -export interface IProposedExtensionAPI { |
125 |
| - environment: { |
126 |
| - /** |
127 |
| - * An event that is emitted when execution details (for a resource) change. For instance, when interpreter configuration changes. |
128 |
| - */ |
129 |
| - readonly onDidChangeExecutionDetails: Event<Uri | undefined>; |
130 |
| - /** |
131 |
| - * Returns all the details the consumer needs to execute code within the selected environment, |
132 |
| - * corresponding to the specified resource taking into account any workspace-specific settings |
133 |
| - * for the workspace to which this resource belongs. |
134 |
| - * @param {Resource} [resource] A resource for which the setting is asked for. |
135 |
| - * * When no resource is provided, the setting scoped to the first workspace folder is returned. |
136 |
| - * * If no folder is present, it returns the global setting. |
137 |
| - * @returns {({ execCommand: string[] | undefined })} |
138 |
| - */ |
139 |
| - getExecutionDetails( |
140 |
| - resource?: Resource, |
141 |
| - ): Promise<{ |
142 |
| - /** |
143 |
| - * E.g of execution commands returned could be, |
144 |
| - * * `['<path to the interpreter set in settings>']` |
145 |
| - * * `['<path to the interpreter selected by the extension when setting is not set>']` |
146 |
| - * * `['conda', 'run', 'python']` which is used to run from within Conda environments. |
147 |
| - * or something similar for some other Python environments. |
148 |
| - * |
149 |
| - * @type {(string[] | undefined)} When return value is `undefined`, it means no interpreter is set. |
150 |
| - * Otherwise, join the items returned using space to construct the full execution command. |
151 |
| - */ |
152 |
| - execCommand: string[] | undefined; |
153 |
| - }>; |
154 |
| - /** |
155 |
| - * Returns the path to the python binary selected by the user or as in the settings. |
156 |
| - * This is just the path to the python binary, this does not provide activation or any |
157 |
| - * other activation command. The `resource` if provided will be used to determine the |
158 |
| - * python binary in a multi-root scenario. If resource is `undefined` then the API |
159 |
| - * returns what ever is set for the workspace. |
160 |
| - * @param resource : Uri of a file or workspace |
161 |
| - */ |
162 |
| - getActiveEnvironmentPath(resource?: Resource): Promise<EnvPathType | undefined>; |
163 |
| - /** |
164 |
| - * Returns details for the given interpreter. Details such as absolute interpreter path, |
165 |
| - * version, type (conda, pyenv, etc). Metadata such as `sysPrefix` can be found under |
166 |
| - * metadata field. |
167 |
| - * @param path : Full path to environment folder or interpreter whose details you need. |
168 |
| - * @param options : [optional] |
169 |
| - * * useCache : When true, cache is checked first for any data, returns even if there |
170 |
| - * is partial data. |
171 |
| - */ |
172 |
| - getEnvironmentDetails( |
173 |
| - path: string, |
174 |
| - options?: EnvironmentDetailsOptions, |
175 |
| - ): Promise<EnvironmentDetails | undefined>; |
176 |
| - /** |
177 |
| - * Returns paths to environments that uniquely identifies an environment found by the extension |
178 |
| - * at the time of calling. This API will *not* trigger a refresh. If a refresh is going on it |
179 |
| - * will *not* wait for the refresh to finish. This will return what is known so far. To get |
180 |
| - * complete list `await` on promise returned by `getRefreshPromise()`. |
181 |
| - * |
182 |
| - * Virtual environments lacking an interpreter are identified by environment folder paths, |
183 |
| - * whereas other envs can be identified using interpreter path. |
184 |
| - */ |
185 |
| - getEnvironmentPaths(): Promise<EnvPathType[] | undefined>; |
186 |
| - /** |
187 |
| - * Sets the active environment path for the python extension for the resource. Configuration target |
188 |
| - * will always be the workspace folder. |
189 |
| - * @param path : Full path to environment folder or interpreter to set. |
190 |
| - * @param resource : [optional] Uri of a file ro workspace to scope to a particular workspace |
191 |
| - * folder. |
192 |
| - */ |
193 |
| - setActiveEnvironment(path: string, resource?: Resource): Promise<void>; |
194 |
| - /** |
195 |
| - * This API will re-trigger environment discovery. Extensions can wait on the returned |
196 |
| - * promise to get the updated environment list. If there is a refresh already going on |
197 |
| - * then it returns the promise for that refresh. |
198 |
| - * @param options : [optional] |
199 |
| - * * clearCache : When true, this will clear the cache before environment refresh |
200 |
| - * is triggered. |
201 |
| - */ |
202 |
| - refreshEnvironment(): Promise<EnvPathType[] | undefined>; |
203 |
| - /** |
204 |
| - * Tracks discovery progress for current list of known environments, i.e when it starts, finishes or any other relevant |
205 |
| - * stage. Note the progress for a particular query is currently not tracked or reported, this only indicates progress of |
206 |
| - * the entire collection. |
207 |
| - */ |
208 |
| - readonly onRefreshProgress: Event<ProgressNotificationEvent>; |
209 |
| - /** |
210 |
| - * Returns a promise for the ongoing refresh. Returns `undefined` if there are no active |
211 |
| - * refreshes going on. |
212 |
| - */ |
213 |
| - getRefreshPromise(options?: GetRefreshEnvironmentsOptions): Promise<void> | undefined; |
214 |
| - /** |
215 |
| - * This event is triggered when the known environment list changes, like when a environment |
216 |
| - * is found, existing environment is removed, or some details changed on an environment. |
217 |
| - */ |
218 |
| - onDidEnvironmentsChanged: Event<EnvironmentsChangedParams[]>; |
219 |
| - /** |
220 |
| - * This event is triggered when the active environment changes. |
221 |
| - */ |
222 |
| - onDidActiveEnvironmentChanged: Event<ActiveEnvironmentChangedParams>; |
223 |
| - }; |
224 |
| -} |
0 commit comments