Files
zed/crates/worktree/tests
Peter Tripp 2240542744 Fix file_type matching for local single-file worktrees (#60307)
## Objective

- Fixes: https://github.com/zed-industries/zed/issues/60304

## Solution

Fixes custom `file_types` language matching for single-file worktrees.
Adds a new `file_system_abs_path` API with full local or remote
filesystem paths for glob matching.

## Testing

New tests ensure `file_types` takes precedence over `path_suffixes` in
single file worktrees, both locally and remotely.

I manually validated builds with this change are also fixed on:
2026-07-02 and 2026-10-05.

Validation:

1. Make sure you do not have SSH Config extension installed.
1. Add `"file_types": {"Rust": ["**/.ssh/config"]}` to your zed
settings.json:
1. From a command prompt:
    ```shell
    mkdir -p /tmp/foo/.ssh/
    touch  /tmp/foo/.ssh/config
    # these work now:
    cargo run -- /tmp/foo/.ssh/config
    cargo run -- ssh://think21:~/.ssh/config
    ```
1. In Nightly language is shown as "Unknown" / in this branch is shows
as "Rust".

## Self-Review Checklist:

- [Yes] I've reviewed my own diff for quality, security, and reliability
- [N/A] Unsafe blocks (if any) have justifying comments
- [N/A] 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)
- [Yes] Tests cover the new/changed behavior
- [Yes] Performance impact has been considered and is acceptable

---

Release Notes:

- Fixed language association for `file_type` path globs with single-file
worktrees

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-10-05 21:46:30 +00:00
..