Skip to content

Unconventional and counterintuitive filename sorting: "." comes after all other characters, should come before #199676

@php4fan

Description

@php4fan

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.84.2
  • OS Version: Manjaro linux

Steps to Reproduce:

  1. Open a project that has files with these names:
functions.php
functions_admin.php
functions_user.php
  1. Look at the list of files in the left panel ("Explorer" I think it's called)

Expected behavior

They should be sorted in this order:

functions.php
functions_admin.php
functions_user.php

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 filename xxxxx 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:

functions_admin.php
functions_user.php
functions.php

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions