microsoft / microsoft/vscode

Support explorer.filesSortOrderReverse and explorer.foldersSortOrderReverse

Open
#325,531 3 comments 0 reactions 1 assignee Claimed by @lramos15 View on GitHub
feature-request file-explorer
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### Summary
This PR introduces two new configuration options: `explorer.filesSortOrderReverse` and `explorer.foldersSortOrderReverse`. These settings allow users to independently reverse the sorting direction of files and folders within the File Explorer, providing more granular control over workspace organization.

### Motivation
Currently, VS Code's `explorer.sortOrder` controls how files and folders are grouped, but it lacks the flexibility to sort folders in one direction (e.g., standard alphabetical) and files in another (e.g., reverse alphabetical).

A major real-world use case for this is **managing content-heavy projects like technical blogs** (e.g., using Markdown-based static site generators like Hugo, Hexo, or Astro):
1. **Folders as Categories:** Authors usually prefer categories/folders to be sorted alphabetically (`A -> Z`) for predictable navigation.
2. **Files as Posts:** Within each category, blog posts are frequently prefixed with publication dates (e.g., `2026-07-12-title.md`). For a better writing workflow, authors want to see the **newest posts at the top**, which requires a reverse chronological/alphabetical sort (`Z -> A`).

Image

*Note: Sorting by file modification time (`modified`) does not solve this, as editing an old post would incorrectly bump it to the top.*

Without this feature, users must install heavy third-party extensions or deal with poor DX where ancient posts clutter the top of their workspace. Introducing these two fine-grained toggles natively solves this workflow gap without disrupting existing sorting algorithms.

### Proposed Changes
- Added `explorer.filesSortOrderReverse` (boolean, default: `false`) to settings schema.
- Added `explorer.foldersSortOrderReverse` (boolean, default: `false`) to settings schema.
- Updated the File Explorer tree comparator logic to independently apply the reverse multiplier depending on whether the item is a file or a folder.
-

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.