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

group files by type #177

Open
ardayigit opened this issue Sep 12, 2024 · 4 comments
Open

group files by type #177

ardayigit opened this issue Sep 12, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ardayigit
Copy link

Is your feature request related to a problem? Please describe.
I appreciate the "Group by type" option in the "Current folder" browser to easily distinguish scripts, functions and other file types. Since both scripts and functions use the same extension, sorting by type doesn't yield an equivalent result.

Describe the solution you'd like
Adding a custom sort order that distinguishes scripts and functions.

Describe alternatives you've considered
As a workaround, all my script files have a name starting by "script_", and all functions "fcn_", so they are sorted together.

@ardayigit ardayigit added the enhancement New feature or request label Sep 12, 2024
@dklilley
Copy link
Member

Hi @ardayigit, thanks for the request!

I am not seeing any options for sorting files in VS Code's "Explore" panel. Can you share some more information about how you are doing this so that we can determine if and how we can hook into this mechanism?

@ardayigit
Copy link
Author

Hi @dklilley!

For sorting order, you can search "explorer sort" in Settings (see screenshot). It uses the class "FileSorter" in "vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts" in the GitHub repo https://github.com/microsoft/vscode.

image

@dklilley
Copy link
Member

Thank you for the extra info!

Unfortunately, taking a look at the code, it looks like this sorting behavior is not currently extensible. Sorting by type appears to strictly sort based on file extension, and does not provide a mechanism to add additional logic.

I have opened an enhancement request for VS Code to provide a mechanism for extending the sorting behavior (microsoft/vscode#228355), which will be required for this enhancement to be made.

@ardayigit
Copy link
Author

Thank you for your time!

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

No branches or pull requests

2 participants