Fix filename sort order edge cases in explorer. by leilapearson · Pull Request #97200 · microsoft/vscode
Partially addresses issue microsoft#27759 Adds compareFileNamesNumeric() and compareFileExtensionsNumeric() funcitons, and uses the new functions in explorer view. Fixes the following edge cases: 1. Sorts the same name with different case in locale order (a < A) instead of unicode order (A < a). 2. Sorts the same name with different accents or diacritics by locale (á < à) instead of in unicode order (à < á) . 3. Sorts names that are equivalent in a numeric locale comparison as shortest numeric representation first (1 < 01 < 001) instead of unicode order (001 < 01 < 1). 4. For filenames with a name plus an extension, compares names first fand then compares extensions (aggregate.go < aggregate_repo.go) instead of comparing the whole name at once (aggregate_repo.go < aggregate.go) 5. Treats dotfiles (filenames that start with a dot) as filenames without extensions, instead of either as an empty filename plus an extension (single-dot dotfile), or a filename that starts with a dot plus an extension (multi-dot dotfile). This means all dotfiles group together in their own section when sorting by file type, (.eslintignore < .eslintrc.json < file.cs < file.js < file.json) instead of being interspersed between files grouped by type (file.cs < .eslintignore < file.js < .eslintrc.json < file.json). Note: other areas of workbench may benefit from the new functions as well but only explorer has been changed so far.