Skip to content

Standardize interpreter display format - #2540

Merged
Don Jayamanne (DonJayamanne) merged 27 commits into
microsoft:masterfrom
DonJayamanne:standardInterpreterDisplayFormat2
Sep 11, 2018
Merged

Don Jayamanne (DonJayamanne) merged 27 commits into
microsoft:masterfrom
DonJayamanne:standardInterpreterDisplayFormat2

Conversation

@DonJayamanne

Copy link
Copy Markdown

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 Don Jayamanne (DonJayamanne) changed the title Standard interpreter display format Standardize interpreter display format Sep 10, 2018
Comment thread src/client/common/platform/pathUtils.ts
Comment thread src/client/common/platform/registry.ts
export class InterpreterComparer implements IInterpreterComparer {
private readonly interpreterHelper: IInterpreterHelper;

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

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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?

Comment thread src/client/interpreter/configuration/interpreterSelector.ts
@DonJayamanne
Don Jayamanne (DonJayamanne) force-pushed the standardInterpreterDisplayFormat2 branch from 78eae0e to 7f7379c Compare September 11, 2018 20:08

@d3r3kk Derek Keeler (d3r3kk) left a comment

Copy link
Copy Markdown

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!

Comment thread src/client/interpreter/configuration/interpreterSelector.ts
}
});
if (!interpreterExists && !details && interpreters.length > 0) {
this.statusBar.tooltip = '';

Copy link
Copy Markdown

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.

Comment thread src/client/interpreter/helpers.ts
Comment thread src/client/interpreter/locators/services/baseVirtualEnvService.ts
Comment thread src/client/interpreter/interpreterService.ts
@DonJayamanne

Copy link
Copy Markdown
Author

Re-run Azure CI

@DonJayamanne
Don Jayamanne (DonJayamanne) merged commit 1b8d456 into microsoft:master Sep 11, 2018
@DonJayamanne
Don Jayamanne (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