Fixing sorting of directory and filenames with numbers#18539
Fixing sorting of directory and filenames with numbers#18539bpasero merged 2 commits intomicrosoft:masterfrom
Conversation
|
@jchadwick incredible, I was not aware of these options. Thanks for enlighten me 👍 |
|
I read this on MDN about String.prototype.localeCompare(): When comparing large numbers of strings, such as in sorting large arrays, it is better to create an Intl.Collator object and use the function provided by its compare property. |
|
yeah I saw that too but it wasn't obvious how to do that here. I can take a stab, though. |
|
Wow. |
c02e2ad to
afc5448
Compare
|
Nice! |
|
LGTM |
|
Hey @bpasero, just an FYI, this wasn't attributed to me in the 1.9 release notes. |
|
@jchadwick sorry for that, I wrongly set this PR for February and so it was not picked up by our automated tool that generates release notes for PRs. I will add this, but it might take a day or two until our website gets redeployed. |
|
Added via microsoft/vscode-docs@229ceeb so it should be in the next website update. |
|
@bpasero No worries. Thanks! |
These changes replace the existing regex-based sorting of filenames and directory names with a call to the
String.prototype.localeCompare()function which supports this natively via thenumericoption.Also added some unit test cases for filenames with numbers.
CC: @bpasero
Fixes #17495