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

Explorer / Opened Editors Sorting #27286

Open
5 of 10 tasks
bpasero opened this issue May 25, 2017 · 75 comments
Open
5 of 10 tasks

Explorer / Opened Editors Sorting #27286

bpasero opened this issue May 25, 2017 · 75 comments
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented May 25, 2017

Numerous issues have been filed on this topic, merging them into one.

Done

Open

@bpasero bpasero added file-explorer Explorer widget issues feature-request Request for new features or functionality labels May 25, 2017
@dineshrajan
Copy link

Want to add one more;
If explorer have 100's of files, scrolling down to find the right one is painful. Will be great if we can type in the file or first few chars and explorer will scroll down to the right file

@csheets
Copy link

csheets commented Oct 19, 2017

agree with the "file filtering" feature - with and without sorting

@ConnorsFan
Copy link

ConnorsFan commented Jan 23, 2018

I would like to have an option to sort the opened editors list by alphabetical order. To be honest, I don't know why that is not the default. The current sort order doesn't make sense to me (and never helps me to find what I want).

@yvbeek
Copy link

yvbeek commented Feb 12, 2018

Working with TypeScript, it would be great to have the barrels (index.ts) sorted at the top.
Would that be possible?

@rodrigoslayertech
Copy link

Everything to complete an IDE is perfect for me! Organization is all in one project!

@wamry
Copy link

wamry commented Feb 28, 2018

to add to #12345
can we have an option to write our own order in json array inside .vscode ? it would make it super easy, the order will follow the order in the array. and also the default json array to always be updated based on the defaults for arrangement , so that if i want to start editing the ordering again from scratch, it would be easy. thanks so much, this is the best text editor ever.

@rodrigoslayertech
Copy link

@Macromeda Check my issue #23231

@wamry
Copy link

wamry commented Mar 3, 2018

@slowaways my idea is to make a json that holds the actual names of the files in the project folder, not ordering by characters.

@charlesr1971
Copy link

We really need this feature. Alphabetical sorting in the Open Editors panel. Thanks...

@will-stone
Copy link

will-stone commented Jun 28, 2018

Ordering by path would be my ideal. When working with huge repos, sorting by alphabetical filename wouldn't cut it as I like to keep my editors organised by where they appear in the codebase.

e.g. this...

Button.js src/components
Card.js src/components
Input.js src/components
Navigation.js src/components
Auth.js src/redux
People.js src/redux
User.js src/redux
map.js src/utils
parse.js src/utils
sort.js src/utils

would be much more useful (to me) than this...

Auth.js src/redux
Button.js src/components
Card.js src/components
Input.js src/components
map.js src/utils
Navigation.js src/components
parse.js src/utils
People.js src/redux
sort.js src/utils
User.js src/redux

This is especially true when working on goliath monorepos.

@lrkwz
Copy link

lrkwz commented Aug 22, 2018

I cannot understand why the ordering is so strange: why the 2016xml files are listed after 2018xml ?

image

@charlesr1971
Copy link

Maybe the default ordering is TextNoCase ASC? A-Z. It is parsing the file name as text rather than a numeric?

@lrkwz
Copy link

lrkwz commented Aug 22, 2018

Looks like is parsing as numeric instead; has is the output of ls | sort -n

@coling
Copy link

coling commented Dec 10, 2018

I don't know if this has been suggested before (or even if it's possible with an extension) but I always prefer to keep the open editors list managed as a mini-tree. i.e. identical to the main folder/files views, but only for open files. I appreciate you can see the folder paths after the file names, but the code I work on has so many similar/identically named files (where only the path differs) that this "extra" data is actually the most important part to me.

@weinand
Copy link
Contributor

weinand commented Feb 13, 2019

I've filed this issue against the strange sort order: "File extensions affect Explorer's sort order"
#67154

@GlenPerkins
Copy link

Use case: I have writing projects (ex: user manual, journal article, book) with sections, sub-*-sections, files. I frequently reorganize the sequence as I work, drag, insert, delete, regroup. I want my work in the explorer to be in the desired sequence without having to rename anything.

Probably no one "best" way to do this, so create an API through which the item-by-item sequence of items in the explorer can be specified, which will allow extensions to provide various options. It should probably also enable a little sort menu so that the sort can be switched with just a click: default <> global:myjsprojects <> global:mytaxprojects <> recents <> local:custom1 <> local:custom1:todo

I would probably like direct drag-and-drop reordering (that remembered my custom order when switching between custom and other sort orders), but that might risk hard-coding something someone doesn't like. Maybe I wouldn't like it. So, I'd probably be just as happy with a FooSort extension that had me sort the items in its own fooSortOrder.config files that could be global and/or local. I could drag and drop items in those almost as easily (as long as it wasn't JSON!), and a file like that could have more sort options. Different extensions could experiment with different sort order specification languages in their own config files (these files at top & bottom, others alpha in middle; or this folder numeric, this folder custom, default folder alpha; or whatever).

@starball5
Copy link

Related: #119207, #91843, #95239.

Related questions on Stack Overflow:

Related on r/vscode: Is there a way to sort files manually?

@malininss
Copy link

I'm still waiting for the ability for sorting index files. It is clear that the PR shouldn't be specified only to javascript, but this modification does not look like something complicated. It's possible to add a custom setting that accepts an array of files to be placed at the top of the tree.

If I add this feature, will the PR be accepted?

@jeff-hykin
Copy link

jeff-hykin commented Oct 12, 2023

If I add this feature, will the PR be accepted?

Probably not. In this thread 3 years ago I did part of a PR A Backwards Compatible, Future-Proofed, ~20-line API Proposal and nothing happened, not even a comment.

@JiveDig
Copy link

JiveDig commented Nov 17, 2023

This issue seems to mention a few different sorting needs. I'm trying to sort all of the top level folders/directories/repos in my Explorer > Workspace in the sidebar. Is this currently possible with or without an extension? I can't figure out a way to do it.

@HonzaKubita
Copy link

HonzaKubita commented Mar 23, 2024

I think that being capable of specifying the order of files in the file explorer is very much a needed feature. I am currently working on a nuxt3 + firebase project and the root directory is getting flooded with folders that are in just random order without any respect what's vue what's css what's logic. I really like the way #119207 solves this issue with the API proposal 1.

@kilianc
Copy link

kilianc commented May 5, 2024

I'd pay for this one #40679 :)

a.go
a_test.go
a_linux.go
a_linux_test.go

instead of

a_linux_test.go
a_linux.go
a_test.go
a.go

@AmbrosiaDevelopments
Copy link

You'll have to pay to buy all of Microsoft to do anything about this. It's easy to keep a subscription to this thread, but I don't think it's ever going to change, we've been waiting 7 years already and they've had multiple PRs and offers of help. Never any constructive feedback. Oh and no extension can perform this behaviour because those APIs are not open to extensions.

@AmbrosiaDevelopments
Copy link

AmbrosiaDevelopments commented May 5, 2024

They've actually closed so many duplicates that as far as I can see there is no open issue left that is requesting the custom sort order people are asking for. This issue just lists all related issues and doesn't mention what its own intention is. Can someone find an open issue that is still asking for custom sorting options or extension API? They keep closing issues saying they don't accept PRs without discussions first but I've been talking about it for 5 years. I have a PR and so do others and they keep saying we need to have community discussions. #141225 and #73930. There is a (relatively) new PR but it doesn't mention an issue #183155

@kilianc
Copy link

kilianc commented May 9, 2024

@AmbrosiaDevelopments is there a way to hack this into the editor so that people can unblock themselves? For example something like this. We could at least document how people can solve this unofficially.

@AmbrosiaDevelopments
Copy link

That's really interesting, I've never seen that before so I'm not sure just yet. It might take me a couple of weeks to get around to it but I'll give it a shot.

@gulshan
Copy link

gulshan commented May 11, 2024

As I have said, I think LSPs or other extensions should also be able to provide custom sorting, hiding and nesting logic for the file explorer. Then extensions will be able to provide some custom logical "view"s beside the default view in the file explorer. Extensions can already handle the nesting. It will remove the need of some custom file explorer widgets. For example, F# projects have their files included (and thus compiled) in a specific order. Now a separate widget is needed to show files in that order. If it was available in the file explorer, the separate widget would not be needed.

@gmanavarro
Copy link

It's been almost 7 years since this issue was opened and there is still no solution.

@AmbrosiaDevelopments
Copy link

AmbrosiaDevelopments commented May 13, 2024

Hi @lramos15, as per comments from @isidorn on #73930, could we please have a conversation about the change proposed by the PR? I have followed the patterns of the existing options and added tests and can see no adverse impacts. This issue we're now talking in doesn't have a purpose at the moment so can we bring the discussion around to this PR and what would be required to get something like this approved and merged? No other issue listed in the first comment is still open except to align behaviour to OS automatically. Do we need to open a new issue or a new PR covering more options than just index files? Would a pattern matching solution be more appropriate for broader coverage of everyone's wishes?

@lramos15
Copy link
Member

@AmbrosiaDevelopments We understand this is a highly requested ask.

What I'm trying to figure out is how to do this is an extensible way that covers everyone's use case as there are a lot of different desired sorting orders. There's two problems with extension API. The first is the extension host can be slow, leading to us being unable to render the tree at all until we get a sort order from the extension. The second one is how multiple extensions contributing a sort order interact.

@jeff-hykin
Copy link

jeff-hykin commented Jun 5, 2024

The second one is how multiple extensions contributing a sort order interact.

@lramos15 Have each extension register a sort-order names based on their extension ID. Ex: username.extname:alphabetical.

Then, in settings, let users pick the order that sorts are applied in:

settings.json

{
    "explorer.sortBy": [
        "foldersFirst", // highest priority
        "username.extname:alphabetical"
    ]
}

The first is the extension host can be slow, leading to us being unable to render the tree at all until we get a sort order from the extension.

I'm personally fine with it being slow.

@php4fan
Copy link

php4fan commented Jul 18, 2024

Issue 199676 should be reopened.

I'm commenting here because not only was it closed, but also locked to comments, for no good reason.

Note that the default, out-of-the-box sorting of files, without tinkering with settings, should be a reasonable one, and it currently isn't.

@kai-353
Copy link

kai-353 commented Nov 7, 2024

I wanted to make an extension that does something like this, but I don't think it is possible with the current VS Code API's. The closest extension I could find was this one by Qing Shun, but it just switches between 2 sort options in the VS Code settings.

Commenting here to keep myself updated.

@AmbrosiaDevelopments
Copy link

AmbrosiaDevelopments commented Nov 8, 2024

@kai-353, the only way to do it for the foreseeable future is to fork vscode for yourself, add any one of the solutions we've made as PRs in here, and keep it up to date when things change upstream, building locally.

@gjsjohnmurray
Copy link
Contributor

I'd pay for this one #40679 :)

@kilianc can you use Explorer file nesting for this? It first appeared in April 2022.

@AmbrosiaDevelopments
Copy link

AmbrosiaDevelopments commented Nov 16, 2024

@gjsjohnmurray, that is a completely different use case and wouldn't help with reordering, it would create annoying multilevel twisties to have to open and close all the time. #40679 should not have been closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Projects
None yet
Development

No branches or pull requests