@diagnostics mention to the thread (#42270)
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>
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking issue)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.