Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDo not use alias name as key for command info cache to fix the problem where UseCorrectCasing corrects aliases #1216
Conversation
…m where UseCorrectCasing corrects aliases
| // If alias name is given, we store the entry under that, but search with the command name | ||
| var key = new CommandLookupKey(aliasName ?? commandName, commandTypes); | ||
|
|
||
| var key = new CommandLookupKey(commandName, commandTypes); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bergmeister
Apr 15, 2019
Author
Collaborator
Ok, done, I also removed the left-over GetCommandInfoInternal function that we moved into the CommandInfoCache a few weeks ago but forgot to delete.
I plan to do another PR with more general tidy up later btw.
…l function from refactoring a few weeks ago

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

bergmeister commentedApr 13, 2019
•
edited
PR Summary
Fixes PowerShell/vscode-powershell#1842
Because aliases were used as the key for the cache, once those entities are created, it caused the UseCorrectCasing rule to correct aliases, somehow those cache entries could only be populated when and lead to this behaviour when being used via the vscode extension so I assume it must the some of the commands being issued at startup that cause other rules to populate this entry
Writing a test for this turned out to be hard as only when being used via the PowerShell vscode extension, alias key entries were populated in PSSA's command info cache first.
The intention is to have this PR fix the root cause and another PR to a bit of a cleanup.
PR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.