-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Unconventional and counterintuitive filename sorting: "." comes after all other characters, should come before #199676
Comments
That fixes the dot but it messes up the underscore. |
Yes, MacOS is crap when it comes to this kind of things. Apple usually goes against conventions by design. |
Either way, having to choose between "dot comes before letters but underscore comes after" and viceversa makes no sense. Nor does the fact that that choice goes together with "default" (whatever that means) vs Unicode. |
And what if I wanted to choose Uppercase first or Lowercase first. What would the behavior of underscore and dot be in those cases? Overall the choice of sorting is utter nonsense. |
Hmmm this is with unicode And here's the way the sort works vscode/src/vs/base/common/comparers.ts Lines 79 to 89 in 168df5b
|
Ok, it seems unicode groups uppercase first, which renders it useless unless you are one of the few people who would want uppercase first. With the files I have, the one I was looking for with an underscore was at the end rather than at the beginning and I mistakenly attributed that to the underscore. This is even worse. So the choice is between: default: "" < "a" < "." => crap |
Maybe keep an eye on #27286 which tracks the idea of being able to provide a custom sort order |
These three choices should be independent of each other:
Probably the last one should be even more granular (or not exist at all and be all before including dot), because even if someone wanted characters like "_" and "-" to come after letters, it may still be convenient for "." to come before, because it separates the file name from the extension (i.e. you would want "xxxx" to come before "xxxx + anything", before the extension). |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
Expected behavior
They should be sorted in this order:
This is the prevailing convention everywhere, it has always been, and for good reason, because it's the only right one. If not in general, certainly for file names.
The dot is commonly conventionally used to separate file name from file extension. Therefore,
xxxxx
followed by a dot means a filenamexxxxx
followed by nothing. And nothing intuitively comes before anything. That's why the dot usually comes before any other (normal) character at least when sorting file names.Again, not only is this the way sorting filenames has always been done and is done everywhere, it is the right way of doing it because it makes sense.
Observed behavior
They are sorted like this:
i.e. the dot (".") comes after any other character.
This is confusing, counterintuitive, illogical, and contrary to prevailing and long-standing conventions. There's no justification for such behavior.
I have seen the same issue before in other pieces of software in Linux (I think starting recently), so VSCode is not alone, but that doesn't make it any less wrong, and it's the exception, not the norm.
The text was updated successfully, but these errors were encountered: