zed/crates/language
Smit Barmase dcfe81f8cc
Support external .editorconfig (#46332)
Closes #41832

Extends https://github.com/zed-industries/zed/pull/19455

When an internal `.editorconfig` is detected in the worktree, we
traverse parent directories up to the filesystem root looking for
additional `.editorconfig` files. All discovered external configs are
loaded and cached (shared when multiple worktrees reference the same
parent directories). When computing settings for a file, external
configs are applied first (from furthest to closest), then internal
configs.

For local projects, file watchers are set up for each external config so
changes are applied immediately. When a project is shared via collab,
external configs are sent to guests through the existing
`UpdateWorktreeSettings` proto message (with a new `outside_worktree`
field). SSH remoting works similarly.

Limitations: We don't currently take creation of new external editor
config files into account since they are loaded once on worktree add.

Release Notes:

- Added support for `.editorconfig` files outside the project directory.
Zed now traverses parent directories to find and apply EditorConfig
settings. Use `root = true` in any `.editorconfig` to stop inheriting
settings from parent directories.
2026-01-19 20:32:32 +05:30
..
src Support external .editorconfig (#46332) 2026-01-19 20:32:32 +05:30
build.rs Fix context line handline in project diagnostic view 2021-12-21 11:46:47 -08:00
Cargo.toml ztracing: Enable memory profiling and callstack sampling (#47052) 2026-01-17 19:29:19 +00:00
LICENSE-GPL chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00