-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Standardize interpreter display format #2540
Conversation
export class InterpreterComparer implements IInterpreterComparer { | ||
private readonly interpreterHelper: IInterpreterHelper; | ||
|
||
constructor(@inject(IServiceContainer) private serviceContainer: IServiceContainer) { |
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.
Can we just use the minimal interface required 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.
(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 { |
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.
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) { |
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.
Perhaps this is meant to check if info.architecture
is undefined?
78eae0e
to
7f7379c
Compare
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.
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 = ''; |
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.
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.
Re-run Azure CI |
Fixes #1351
package.json
are pinned (e.g."1.2.3"
, not"^1.2.3"
for the specified version)package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed)