Skip to content
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

Add a shortlex sort order to the file explorer #66768

Closed
leidegre opened this issue Jan 19, 2019 · 4 comments
Closed

Add a shortlex sort order to the file explorer #66768

leidegre opened this issue Jan 19, 2019 · 4 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@leidegre
Copy link

leidegre commented Jan 19, 2019

I just realized the sort order used in VS Code for file explorer is different than for example the Windows File Explorer.

image

This caught me by surprise. The reason for this is that the file name comparison function doesn't take into account the length of the file name. Under shortlex rules you would consider a file name of shorter length to be smaller than a file name of longer length.

I like the default layout with folders before files but I would like there to be an option to enable shortlex sorting. I think it's common enough to even argue that it should have been the default it's just an easily overlooked fact.

For example, this is what I get if I traverse the files using the dir /b command.

C:\Users\leidegre\Source\tessin\tcm\tcm-backend\src\tessin\ddd>dir /b
aggregate.go
aggregate_registry.go
event.go
event_registry.go
README.md
rehydration.go

This is exactly the way the files are returned from the file system, in this case NTFS. I could even argue that there is a miniscule benefit from having similar sort in the file explorer view as the files are handed to you by the underlying file system APIs (even if this is mostly a edge case on Windows).

I'm no expert on the VS Code codebase but I would presume that some change to these functions would be necessary so that they take length into consideration.

This could either be made as an toggle option, on top of existing sort rules, or it could just be made as a feature enhancement as I don't know for a fact, if the current file sort order was intended to not explicitly use shortlex rules or not. (I obviously think they should 😄)

@isidorn isidorn added the *duplicate Issue identified as a duplicate of another issue(s) label Jan 21, 2019
@vscodebot
Copy link

vscodebot bot commented Jan 21, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Jan 21, 2019
@leidegre
Copy link
Author

@isidorn would be nice to know which one, wasn't like I spent all that time writing up a detailed summary and not searching for existing issues...

@leidegre
Copy link
Author

I'm going to assume it's this one. #27759

@isidorn
Copy link
Contributor

isidorn commented Jan 21, 2019

Yeah. There's also one about more sorting in the explorer.
Search for issues tagged with file explorer and feature request.

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants