Skip to content

Make PowerShell names case insensitive for configuration #2399

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
merged 2 commits into from
Jan 7, 2020

Conversation

rjmholt
Copy link
Contributor

@rjmholt rjmholt commented Jan 2, 2020

PR Summary

Makes PowerShell names in settings case insensitive.

Resolves #2380.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@rjmholt rjmholt requested a review from TylerLeonhardt January 2, 2020 22:15
@@ -127,7 +127,8 @@ export class SessionManager implements Middleware {
let powerShellExeDetails;
if (this.sessionSettings.powerShellDefaultVersion) {
for (const details of this.powershellExeFinder.enumeratePowerShellInstallations()) {
if (details.displayName === this.sessionSettings.powerShellDefaultVersion) {
const wantedName = this.sessionSettings.powerShellDefaultVersion;
if (wantedName.localeCompare(details.displayName, undefined, { sensitivity: "accent" }) === 0) {
Copy link
Member

Choose a reason for hiding this comment

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

What's the undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The locales parameter. Taken from this SO answer. There doesn't seem to be a more elegant way to do it unfortunately.

Copy link
Member

Choose a reason for hiding this comment

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

Can you maybe throw that link to SO here in a comment?

Copy link
Member

Choose a reason for hiding this comment

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

Ehhh or you don't have to. It's not that important

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

LGTM

@rjmholt rjmholt merged commit 17c520a into PowerShell:master Jan 7, 2020
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.

[Preview] powerShellDefaultVersion workspace setting doesn't work for autodiscovered paths
2 participants