mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-19 15:10:34 +01:00
8d085f1928
## Objective Import VS Code’s `files.exclude` into `file_scan_exclusions`. The previous `files.watcherExclude` mapping was dead code: it expected an array, while VS Code stores an object of `pattern: bool`. `files.watcherExclude` only stops watching, and the files stay visible in VS Code, so it is not a match for `file_scan_exclusions`. `files.exclude` hides files from the explorer and search, which matches `file_scan_exclusions`, and its default set is nearly identical to Zed's. Related to #62769, reported during the review of #64484. A meta follow-up to #64399. ## Solution Import nonempty `files.exclude` patterns enabled with `true`, ignoring disabled and malformed entries, including VS Code's `{"when": ...}` form. Append `"..."` so the imported list extends inherited exclusions instead of replacing them. Inputs with no usable patterns leave the inherited list unchanged. `files.watcherExclude` is no longer imported. ## Testing The new regression tests reproduce the bug and verify the fix. To check manually, import `{"files.exclude":{"**/build/**":true,"**/cache/**":false}}` and verify that `file_scan_exclusions` becomes `["**/build/**", "..."]`, and that `.git` stays hidden in the project panel. ## Self-Review Checklist: - [x] I’ve reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed’s UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed importing VS Code `files.exclude` into `file_scan_exclusions`. --------- Co-authored-by: Kirill Bulatov <kirill@zed.dev>