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

Sort folders/projects in multi-root workspace #41351

Closed
stu-fu opened this issue Jan 9, 2018 · 33 comments
Closed

Sort folders/projects in multi-root workspace #41351

stu-fu opened this issue Jan 9, 2018 · 33 comments
Assignees
Labels
*extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality file-explorer Explorer widget issues workbench-multiroot Multi-root (multiple folders) issues
Milestone

Comments

@stu-fu
Copy link

stu-fu commented Jan 9, 2018

Could the ability be added to some way sort the list of folders/projects that are in a multi-root workspace? From what it seems, they only stay arranged in the order in which they are added.

@bpasero bpasero added feature-request Request for new features or functionality workbench-multiroot Multi-root (multiple folders) issues labels Jan 10, 2018
@WraithKenny
Copy link

You can edit them in the xxxx.code-workspace file, moving them around in the json array, but that's no fun.

I definitely thing that dragging the folders around to reorder them in the sidebar should update it in the .code-workspace file anyway. Hopefully you guys agree.

Also, moving them will have a subtle side-effect for the (deprecated) ${workspaceRoot} variable, which will fallback to workspaceFolders[0]. But that shouldn't really be behavior that's relied on. It'd be kinda nice for when an extension does rely on that, but you have the wrong "root" folder at the top, to be able to correct it with a drag of a folder.

@chimit
Copy link

chimit commented Feb 21, 2018

+1 It's really needed.

@mattgen88
Copy link

My large workspaces have 20+ projects, trying to find the right one when it is not alphabetical is a pain. Being able to sort the workspace would help tremendously. Sorting JSON is not a user-friendly fix.

@iciclesoft
Copy link

I've created an extension with which you can sort these folders alphabetically that can be used until it's fixed in VSCode. Search for the extension WorkspaceSort or view the source on GitHub.

@bhagatparwinder
Copy link

Thanks, @iciclesoft works great! This is a must-have feature for VSCode.

@chris-c-thomas
Copy link

@iciclesoft Thanks for this! I agree this functionality is really needed as some of my workspaces are very large and sorting through the projects is tough at times.

@chris-c-thomas
Copy link

Any updates on this functionality?

@bpasero bpasero added the file-explorer Explorer widget issues label Sep 12, 2018
@Marcholio
Copy link

Marcholio commented Jan 25, 2019

Any updates on this?

@andrefedev
Copy link

I join the same request. Native support from Visual Studio Code would be great.

@mattizhu
Copy link

This would help a lot of developers with 20+ project folders in one workspace. Support for this would complete my way of using VSCode.

@philanderson888
Copy link

Yes this is a real pain that it's not natively implemented by the way. Just having it in the same order that Windows Explorer lists the files would be a great help.

@eclectic-coding
Copy link

any updates? A definite pain.

@philandersonsparta
Copy link

any updates? A definite pain.

@polishedwp Hey Chuck that VSCode plugin mentioned works just fine. Just add 'WorkspaceSort' to your VSCode plugins then right click on a workspace folder and choose 'Sort Workspace Folders'. Hope that helps :)

@eclectic-coding
Copy link

any updates? A definite pain.

@polishedwp Hey Chuck that VSCode plugin mentioned works just fine. Just add 'WorkspaceSort' to your VSCode plugins then right click on a workspace folder and choose 'Sort Workspace Folders'. Hope that helps :)

Yeh, I installed and it works fine. I was hoping that VSC would have drag and drop reordering support, but the plugin does add some functionality.

@mathmul
Copy link

mathmul commented Apr 10, 2019

You can edit them in the xxxx.code-workspace file, moving them around in the json array, but that's no fun.

I definitely thing that dragging the folders around to reorder them in the sidebar should update it in the .code-workspace file anyway. Hopefully you guys agree.

Also, moving them will have a subtle side-effect for the (deprecated) ${workspaceRoot} variable, which will fallback to workspaceFolders[0]. But that shouldn't really be behavior that's relied on. It'd be kinda nice for when an extension does rely on that, but you have the wrong "root" folder at the top, to be able to correct it with a drag of a folder.

WorkspaceSort works great for sorting alphabetically! But in my case, where I have my ALL (WORKSPACE) with 29 production workspace folders and 1 development workspace folder (parent to all before-production projects), your solution is great, so I could move development workspace folder to the top of the list. Kudos!

@eedwards-sk
Copy link

any updates? A definite pain.

@polishedwp Hey Chuck that VSCode plugin mentioned works just fine. Just add 'WorkspaceSort' to your VSCode plugins then right click on a workspace folder and choose 'Sort Workspace Folders'. Hope that helps :)

Yeh, I installed and it works fine. I was hoping that VSC would have drag and drop reordering support, but the plugin does add some functionality.

vscode DOES have drag and drop reordering support

@erikpaasonen
Copy link

So can this be closed then? with drag-and-drop folder re-ordering now working?

@eclectic-coding
Copy link

@erikpaasonen Yes, we can close this one.

@eedwards-sk
Copy link

I disagree. Being able to click and drag them around isn't necessarily effective sorting. It's reordering, but not sorting.

Right now we're limited to 3rd party extensions.

First party support where e.g. I could shift-select a group of workspace folders and sort them would be ideal (similar to 'Sort Lines Ascending')

@BeyondEvil
Copy link

BeyondEvil commented Jun 11, 2019

How can this NOT be supported? Do you even code? 😉

@mattgen88
Copy link

@BeyondEvil It really doesn't hurt to be respectful and congenial. No one is going to move any faster because of your comment.

@erikpaasonen @polishedwp It would be preferred to be able to actually sort as well. Every time I add an additional repo to my ever growing list of repos (literally up over 100 repos for libraries and widgets for a large project now), it'd feel clunky to try and drag it into place. My current work flow is to blow away the workspace and re-add all the repos if I want them in alphabetical order. Luckily I have a single root for my project repos instead of multiple roots per the original requester. My feedback would be that drag ordering is insufficient to fulfill the criteria of the request.

@BeyondEvil
Copy link

@mattgen88 Fixed it. Just for you! 😘

@maelcaldas
Copy link

Its really a pain having more than 15 workspace folders and repos in aleatory order... It causes us an unnecessary constant effort when finding and switching between projects. Drag and drop does not solve this. It instead create another task to be done when adding new folders and repos. :-/

@isidorn isidorn self-assigned this Oct 8, 2019
@isidorn isidorn added this to the Backlog milestone Oct 8, 2019
@marvingreenberg
Copy link

This might be considered a bug, although it is ambiguous. In a multi-root workspace, the folders are sorted according to the order in which they are added, and can be reordered by dragging. But there is a setting Explorer->Sort Order that says that the ordering will be (by default) that folders are sorted alphabetically.

Either provide a SEPARATE setting to allow sorting of ROOT folders in a multi-root workspace, OR have the ordering of the root folders honor the Explorer->Sort Order setting(s). Although dragging does allow for some ordering, it is not very convenient.

@Jonathan0wh
Copy link

Now VScode could already config 5 ways to sort files and folders in Explorer:

VScode setting Folder Structure

But these files and folders are sorted in case-insensitive alphabetical order. Is it possible to add a case-sensitive setting or option to allow the files and folders to be sorted in case-sensitive alphabetical order, like the default way in Github here:

Github way of sorting files and folders

@gjsjohnmurray
Copy link
Contributor

@Jonathan0wh I think your request belongs in #27286. This one here is about sorting the root-level folders of a multiroot workspace.

@Slooz
Copy link

Slooz commented Apr 15, 2020

I wanted to point out that dragging and dropping in multi-root workspaces is confusing. To drag and drop you have to drag a folder onto another folder. The UI makes it seem like this action will move the folder into another folder, rather than just changing the order of the folders.

This behavior made me think that dragging and dropping wasn't supported, which is how I found this issue.

@LucaGabi
Copy link

please read this feature request here: #95182, upvote if useful

@bzdyelnik
Copy link

Just dropping by to +1 this. Thanks devs!

@crazy-matt
Copy link

.....
....
2 years later.... 😴

@azinit
Copy link

azinit commented Jul 17, 2021

Still actual!!!!

It demotivates to hardcode prefixes for needed file structure 😕
image

@isidorn isidorn assigned JacksonKearl and unassigned isidorn Aug 12, 2021
@JacksonKearl JacksonKearl added the *extension-candidate Issue identified as good extension implementation label Aug 13, 2021
@JacksonKearl
Copy link
Contributor

The extension mentioned here seems to provide the desired functionality: #41351 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality file-explorer Explorer widget issues workbench-multiroot Multi-root (multiple folders) issues
Projects
None yet
Development

No branches or pull requests