mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-27 00:08:42 +00:00
Closes #31351 # Diagnostics Mention in New Threads ## Overview Adds the `@diagnostics` mention to the new Agent Panel threads so users can inject current LSP diagnostics (errors by default) without switching to a text thread. The diagnostics mention is fully integrated into ACP mention parsing, the context picker, and the message-editor pipeline so it round-trips cleanly and shows up in the standard `@` menu. ## Context - **Request:** bring `/diagnostics` parity to the “New Thread” assistant experience. - **Scope:** diagnostics only; `/terminal` mention would be implemented in a separate PR. - **Docs:** updated Agent Panel docs + changelog. ## Implementation Details 1. **Mention plumbing** - Added `MentionUri::Diagnostics` to `acp_thread`, including parsing (`zed:///agent/diagnostics?include_warnings=true`) and icon/name metadata. - Tests ensure diagnostics links round-trip via Markdown mention serialization. 2. **Context picker / completion** - New `ContextPickerMode::Diagnostics` exposes an `@diagnostics` entry in the mention menu. - Completions turn `@diagnostics` into a fully fledged mention, reusing the existing confirmation pipeline. 3. **Message editor + thread serialization** - Resolving the mention calls the existing diagnostics collector from `assistant_slash_commands`, embedding the tool output inline with other context blocks (`<diagnostics>…</diagnostics>`). - Thread-link handling ignores diagnostics backlinks so clicking them doesn’t try to reopen nonexistent resources. # How it looks <img width="800" height="480" alt="image" src="https://cf5gpe8lxo.ufs.sh/f/EmJ5Xl877qJO1mzC9Zrn8AmJZHeShC4RoUwvTMlF2tfPzj06" /> Release Notes: - Allow mentioning diagnostics in the agent panel via `@diagnostics` --------- Co-authored-by: Bennet Bo Fenner <bennet@zed.dev> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||