zed/crates/docs_preprocessor
Joseph T. Lyons d92c12e86e
Fix docs preprocessor preferring parameterized keybindings over exact matches (#54593)
This PR fixes a bug with the docs pre-processor where it could match on
parameterized versions of key binds before exact matches.

I noticed this bug in the latest [parallel agent
docs:](https://zed.dev/docs/ai/parallel-agents#switching-threads)

<img width="717" height="110" alt="SCR-20260423-bhtn"
src="https://github.com/user-attachments/assets/ea20b592-55c3-4e92-9c2e-ff821efacdd8"
/>

Here, the preprocessor is matching on the parameterized version first:

```json
"ctrl-tab": "agents_sidebar::ToggleThreadSwitcher",
"ctrl-shift-tab": ["agents_sidebar::ToggleThreadSwitcher", { "select_last": true }],
```

This bug surfaced in some other places in the docs as well:

- https://zed.dev/docs/ai/agent-panel#multiple-threads
- https://zed.dev/docs/finding-navigating#project-search
- https://zed.dev/docs/finding-navigating#quick-reference
- https://zed.dev/docs/migrate/webstorm#no-indexing
- https://zed.dev/docs/migrate/webstorm#differences-in-user-interfaces

Self-Review Checklist:

- [X] I've reviewed my own diff for quality, security, and reliability
- [N/A] Unsafe blocks (if any) have justifying comments
- [N/A] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [X] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-04-23 12:04:17 +00:00
..
src Fix docs preprocessor preferring parameterized keybindings over exact matches (#54593) 2026-04-23 12:04:17 +00:00
Cargo.toml Fix docs validation to detect unknown keys (#49660) 2026-02-19 20:46:21 -05:00
LICENSE-GPL Don't rely on relative path for docs preprocessor (#16883) 2024-08-26 11:43:13 -04:00