Skip to content

ActiveEnvironmentChangedParams in the API doesn't support multiple conda env sharing the same interpreter path #18735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DonJayamanne opened this issue Mar 21, 2022 · 3 comments
Assignees

Comments

@DonJayamanne
Copy link

DonJayamanne commented Mar 21, 2022

Testing #18727

The following event should use the new type EnvPathType

  • ActiveEnvironmentChangedParams
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Mar 21, 2022
@karrtikr
Copy link

The path property in

export interface ActiveEnvironmentChangedParams {
    /**
     * Path to environment folder or path to interpreter that uniquely identifies an environment.
     * Virtual environments lacking an interpreter are identified by environment folder paths,
     * whereas other envs can be identified using interpreter path.
     */
    path: string;
    resource?: Uri;
}

refers to EnvPathType.path. We don't provide EnvPathType.pathType in the ActiveEnvironmentChangedParams as it isn't useful, can you explain where it can be used?

@DonJayamanne
Copy link
Author

I would have assumed it was useful
E.g. assume we have Interpreter A, B, C (where B & C are conda envs with the same interpreter path)
Now i select B, i have no idea from the event whether it points to B or C. In fact I have to use the existing API to check what the active interpreter is, meaning the path property in the event arg is never going to be useful in such cases (in fact it should never be used as it could point to C).
Thus I'd think we should either remove path (which feels much simpler & cleaner) or we should expose the type as well.

@karrtikr
Copy link

Now i select B, i have no idea from the event whether it points to B or C.

You do have an idea, as path will denote the path to the environment folder which is different for B and C. Think of path as an id.

@karthiknadig karthiknadig removed the triage-needed Needs assignment to the proper sub-team label Mar 22, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants