Skip to content

Resolved Environments have an invalid type for workspaceFolder #20104

@DonJayamanne

Description

@DonJayamanne

When using the Python Extension API, the resolve Enviornments have an incorrect type for the property workspaceFolder.
workspaceFolder is not a Uri object, but a regular Object.

I've looked at the code, the problem is the fact that enviornments are serialized into JSON and then restored back again when storing from/into the memento.

Note: Objects with Uris cannot be stored in Memento nor can they be serialized into JSON and then parsed back

https://github.com/DonJayamanne/pythonVSCode/blob/main/src/client/pythonEnvironments/base/locators/composite/envsCollectionCache.ts#L186

This is causing issues in the Python extension and new environments are not geting picked up because we're now filtering these enviornments based on the workspace Folder, however since the worksapceFolder isn't a Uri object the conditions fail and as a result new Python virtual envoirnments end up getting excluded in Jupyter extension.

Metadata

Metadata

Assignees

Labels

area-environmentsFeatures relating to handling interpreter environmentsauthor-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable bugneeds PRReady to be worked onverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions