Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Sort available environments by assumed usefulness #16559
Sort available environments by assumed usefulness #16559
Changes from 10 commits
9eaa950
075fd57
6f5447e
f452103
ed65116
d660e41
776b11f
ef7f9c3
eb9e895
c6a7275
953e1fa
74b2949
466f40b
4f96aec
ce20edf
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paths probably should be normalized before comparing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This helper should be useful,
vscode-python/src/client/common/platform/fs-paths.ts
Lines 151 to 158 in 488aaa2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnvTypeHeuristic.Local
can also be of other types, includingUnknown
. I think we should be doing the check of whether an env is local prior to checking env types.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So from what I understand you are suggesting that any environment path that has the workspace as the parent path should be considered local? How can an environment end up categorized as
Unknown
again?I think that if we failed to identify an environment it shouldn't be prioritized it over others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
If none of our environments type checks matches, a local environment can be classified as
Unknown
.vscode-python/src/client/pythonEnvironments/base/locators/lowLevel/workspaceVirtualEnvLocator.ts
Line 59 in a393225
But practically speaking it shouldn't happen. So maybe we shouldn't worry about the
Unknown
case in local envs.Or we can make an exception case as you suggested here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides
Venv
andUnknown
, which other environment types could possibly be categorized as local?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Poetry
,conda
can both have local and global versions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Virtualenv
,Pipenv
can be in there as well. Basically I don't think we should define local envs based on kind.