microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.81k stars 29.12k forks source link

Explorer / Opened Editors Sorting #27286

Open bpasero opened 7 years ago

bpasero commented 7 years ago

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

Done

Open

aswinkumar863 commented 2 years ago

I primarily work in MVC kind of projects, where I have to group controller files next to each other, followed by view files and so on. So, I'm also in need of this feature and I finally created a VS Code extension to solve this. You can either sort automatically or manually using my extension.

Check out my extension at here: https://marketplace.visualstudio.com/items?itemName=aswinkumar863.sort-editors

QuarticCat commented 2 years ago

I pretty much like these two sorting behaviors in CLion:

I hope the API can implement both of them.

Since IntelliJ Rust is a plugin, I believe there exists some API to customize the sort order in Jetbrains IDEs.

gulshan commented 2 years ago

Can LSP be allowed to handle the sorting/hiding/nesting of the files and folders in the explorer?

ivxvm commented 2 years ago

It's been 5 years 4 months 2 days since this issue was opened and there is still no solution.

acherkashin commented 1 year ago

I would like to show README.md as a first element in sidebar to make it easy to find for new developers. In this case, they will be able to quickly look at the directory description.

starball5 commented 1 year ago

Related: #119207, #91843, #95239.

Related questions on Stack Overflow:

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

malininss commented 1 year ago

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 commented 1 year ago

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 commented 11 months ago

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 commented 7 months ago

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 commented 5 months ago

I'd pay for this one https://github.com/microsoft/vscode/issues/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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

@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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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

AmbrosiaDevelopments commented 5 months ago

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 commented 5 months ago

@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 commented 4 months ago

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 commented 3 months ago

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.