Skip to content

Conversation

@karthiknadig
Copy link
Member

@karthiknadig karthiknadig commented Aug 13, 2021

Closes #16971
Closes https://github.com/microsoft/vscode-python-internalbacklog/issues/277

No defaultInterpreterPath set:

image

defaultInterpreterPath set to python:

image

defaultInterpreterPath set to some python executable in the user settings:

image

defaultInterpreterPath set to some python executable:

image

@karthiknadig karthiknadig self-assigned this Aug 13, 2021
Copy link

@karrtikr karrtikr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Star" should be next to the autoselected interpreter (the interpreter we suggest) in the list. I don't think this PR does that.

@karthiknadig
Copy link
Member Author

karthiknadig commented Aug 14, 2021

@karrtikr what do you mean. The star is placed on the first entry from the suggestions list. Given our new sorting logic, that will be the auto-selected interpreter. If there is a defaultInterpreterPath then it will be show as the default interpreter path, in my example you can see that I have defaultInterpreterPath that is my global python, and a .venv in the folder. Our "suggestion" there is to use the .venv one, even though we are going to use the defaultInterpreterPath.

@karrtikr
Copy link

karrtikr commented Aug 14, 2021

The star is placed on the first entry from the suggestions list. Given our new sorting logic, that will be the auto-selected interpreter.

@karthiknadig Ah I see, I missed that first interpreter will always be the autoselected one. But I don't think we should rely on this logic, instead we should get the autoselected interpreter by searching in the list. That way we're not duplicating the "first interpreter = autoselected interpreter" logic in two places.

Also, I don't see the point in the "star" icon if it's always going to be on the first one. Earlier, that was not the case, which is when the work item was created.

@karthiknadig
Copy link
Member Author

I don't see a point to star as well. I agree with you on that. So let use see what @luabud thinks.

@luabud
Copy link
Member

luabud commented Aug 16, 2021

@karthiknadig about this example:

image

if the terminal isn't activated, "python" would not be the .venv one, right? In that case wouldn't it show the same as in the "defaultInterpreterPath set to some python executable" example, but with the path being the same as what "python" is set to on PATH?

The main reason why I think adding the star is helpful is for cases where users who are getting started with/learning Python may have a couple of environments on their machine but they don't know which one to use. It was kind of a partner's ask/suggestion, the idea of adding some sort of "suggested" tag to environments to help users with that.

@karthiknadig
Copy link
Member Author

What "python" means in a given scenario is not something we can tell without running it. This is especially true in the case of pyenv. The other thing is, new auto-selection sorting makes it so that the first python is the most likely python, and if users don't select we select it for them. So I think the scenario has changed a bit, due to how we sort and auto-select.

@karthiknadig karthiknadig requested a review from karrtikr August 17, 2021 17:19
);
return `${Octicons.Star} ${labelText()}`;
},
label: localize('InterpreterQuickPickList.defaultInterpreterPath.label', 'Use default Python interpreter path'),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A reminder that this text needs to be changed.


quickPick.items = newSuggestions;
quickPick.activeItems = [interpreterSuggestions[0]];
quickPick.activeItems =

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you show how it looks? Also, I feel Enter interpreter path... should be pinned if we're scrolling to the active item.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to pin it? From the chat in slack, it looks like there is no option to make it "sticky" right now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sorry, doesn't look like it. But it's weird then, I don't like us scrolling to the selected item in that case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@luabud What is your opinion?
This is what it looks like when you select items at the top:
image

This is what it looks like when you select something in the bottom:
image

essentially we don't see the 'enter path' and 'default path'.
I can revert back to the previous state. if we don't like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After an offline discussion with Luciana, we are going to keep this as we have in the latest commit. That is, the blue highlight is on the item that is selected and it scrolls to that item on opening the quick pick.

@karthiknadig karthiknadig merged commit db1acaa into microsoft:main Aug 18, 2021
@karthiknadig karthiknadig deleted the interpreter-order branch August 18, 2021 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve default interpreter path suggestion in quickpick UI

3 participants