Skip to content

Custom File Explorer Order #183155

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GBrunelli
Copy link

This PR addresses one of the issues from #27286 and fixes #25724.

This new configuration provides users with enhanced control over their coding environment. By utilizing this feature, developers can customize the organization of their file explorer based on their preferences. Files and folders matching the specified list will be displayed with priority, following the specified order.

This functionality enables developers to navigate their codebase more efficiently by tailoring the file explorer to suit their individual workflows. Whether it's prioritizing specific files, focusing on particular folders, or grouping related elements together, users have the flexibility to optimize their coding experience.

To test it, just go to Settings (File → Preferences → Settings) and search for: explorer.customOrder. Add file or folders names to the list and see them go to the top of their directory.

@GBrunelli
Copy link
Author

@GBrunelli please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@lramos15
Copy link
Member

I don't think this is the solution we want. It feels super hacky to me to have to list out your files this way. How does this work if your file is in a folder? Do I have to list out the whole path? I wanted a way to statically define sort rules in a robust way to fit everyone's custom sort requirements, but have not found one yet.

@GBrunelli
Copy link
Author

GBrunelli commented Jun 5, 2023

I don't think this is the solution we want. It feels super hacky to me to have to list out your files this way. How does this work if your file is in a folder? Do I have to list out the whole path? I wanted a way to statically define sort rules in a robust way to fit everyone's custom sort requirements, but have not found one yet.

You don't have to list the whole path, for example, if I add "index.ts" to the list, it will appear on top of the repository in any folder it is in.

I'll link some images for you to see how it looks like with some different rules.

EX1: Ordering CRUD folders:

image

image

EX2: Always placing index.ts on top.

image

image

EX3: Ordering files and folders in a way that the folder 'database' will always appear on top following 'index.ts'

image

image

I think I can improve this by instead of just passing a plain string, enabling the user to provide a regular expression, so it will be much more flexible, what do you think about that?

@pauloch8
Copy link

I was today trying to do exctly that as an extension and I found it is not possible to change File Explorer by extensions.

It is suitable to me as I want index.ts to be at top of the files list because I will have a lot of those files in folders that I use as modules. It is very annoying to have a lot of index files in the middle of other more relevant files like that:

image

I think maybe the match string could be a regex, so we could do more broadly combinations using names of folders

@recatek
Copy link

recatek commented Sep 16, 2024

This would also be useful in Rust for mod.rs, lib.rs, and main.rs files that have special top-level importance for crates and modules within said crates. RustRover provides similar functionality and I find it very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature to assign a particular file name to appear first in a directory listing
5 participants