Closed
Description
Refs: #18357
- anyOS: @rchiodo
- anyOS: @DonJayamanne
Complexity: 3
Requirements
Tagging the team who previously tested #18348.
- Use pre release build of the python extension.
- Context: Multiple environments can now share the same interpreter path with Support discovering multiple conda envs with same interpreter path #18357, so interpreter path can no longer be considered as the key. For envs lacking an interpreter, path to environment folder is now considered as key, and the following type is returned via the API:
vscode-python/src/client/pythonEnvironments/base/info/index.ts
Lines 31 to 39 in f1d0509
Test APIs exposed via IProposedExtensionAPI
- Create two conda environments without python:
conda create -n test1
conda create -n test2
We want to make sure these can be discovered and selected.
-
Check https://github.com/microsoft/vscode-python/pull/18427/files#diff-5dd4c66e9be787a2f10dad4947293e8c303251166e40f553edc743b336db5b75 for the updates made to the API.
-
See
IProposedExtensionAPI
for APIs to test.vscode-python/src/client/apiTypes.ts
Line 127 in f1d0509
Example usage:
Copy over contents of https://github.com/microsoft/vscode-python/blob/main/src/client/apiTypes.ts as needed.
const extension = extensions.getExtension('ms-python.python');
if (extension) {
if (!extension.isActive) {
await extension.activate();
}
const api: IExtensionApi & IProposedExtensionAPI = extension.exports as IExtensionApi & IProposedExtensionAPI;
if (api.environment) {
interpreterPath = await api.environment.getActiveEnvironmentPath();
}
}