Skip to content

Standardize interpreter display format #2540

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

Merged

Conversation

DonJayamanne
Copy link

Fixes #1351

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Has unit tests & system/integration tests
  • [n/a] Any new/changed dependencies in package.json are pinned (e.g. "1.2.3", not "^1.2.3" for the specified version)
  • [n/a] package-lock.json has been regenerated by running npm install (if dependencies have changed)

@DonJayamanne DonJayamanne changed the title Standard interpreter display format Standardize interpreter display format Sep 10, 2018
@DonJayamanne DonJayamanne requested a review from d3r3kk September 10, 2018 23:24
export class InterpreterComparer implements IInterpreterComparer {
private readonly interpreterHelper: IInterpreterHelper;

constructor(@inject(IServiceContainer) private serviceContainer: IServiceContainer) {
Copy link

Choose a reason for hiding this comment

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

Can we just use the minimal interface required here?

Copy link

Choose a reason for hiding this comment

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

(If we only need IInterpreterHelper, why not just add that to the constructor?)

constructor(@inject(IServiceContainer) private serviceContainer: IServiceContainer) {
this.interpreterHelper = this.serviceContainer.get<IInterpreterHelper>(IInterpreterHelper);
}
public compare(a: PythonInterpreter, b: PythonInterpreter): number {
Copy link

Choose a reason for hiding this comment

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

What happens when they are equal?

I would expect (in a canonical sense, perhaps) that a compare method would return 1, 0, -1.

Maybe a rename will clear this up? Such as isGreaterThan or something such as that.

if (info.version_info && info.version_info.length > 0) {
sortNameParts.push(info.version_info.slice(0, 3).join('.'));
}
if (info.version_info) {
Copy link

Choose a reason for hiding this comment

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

Perhaps this is meant to check if info.architecture is undefined?

@DonJayamanne DonJayamanne force-pushed the standardInterpreterDisplayFormat2 branch from 78eae0e to 7f7379c Compare September 11, 2018 20:08
Copy link

@d3r3kk d3r3kk left a comment

Choose a reason for hiding this comment

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

Looks good, let's take time to discuss my idea about revising the pattern we currently use for identifying virtual environments, not a blocker for this PR.

I like the change and think it moves us forward in the right direction!

}
});
if (!interpreterExists && !details && interpreters.length > 0) {
this.statusBar.tooltip = '';
Copy link

Choose a reason for hiding this comment

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

Might be something we can use to alert the newer users that they need to pick one of these, and give them some guidance? Might be something we can add to the 'getting started' project.

@DonJayamanne
Copy link
Author

Re-run Azure CI

@DonJayamanne DonJayamanne reopened this Sep 11, 2018
@DonJayamanne DonJayamanne merged commit 1b8d456 into microsoft:master Sep 11, 2018
@DonJayamanne DonJayamanne deleted the standardInterpreterDisplayFormat2 branch October 2, 2018 22:46
@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve display names of interpreters in the list and status bar
2 participants