Closes #63084. Zed already normalizes most empty and line-terminator-only diagnostic ranges onto an adjacent character. A diagnostic can still remain a true point when its position has no glyph, such as column zero of an empty line or an empty file. The shaped-text path has no `TextRun` at that position, so the diagnostic appears in diagnostic UI but has no editor squiggle. Render only diagnostics that remain zero-width after ingress as a one-em wavy underline at their `DisplayPoint`. This keeps the stored LSP range unchanged, uses the existing diagnostic underline policy and font metrics, and also paints the decoration in a pinned sticky-header copy when an anchored point survives an edit. ## Evidence ### Empty Go file with gopls Before: <img width="471" height="430" alt="Empty Go file before the fix: diagnostic message without a squiggle" src="https://github.com/user-attachments/assets/a7f29dd3-a16c-43ea-a53f-d0264efb4ce0" /> After: <img width="471" height="430" alt="Empty Go file after the fix: diagnostic message with a point squiggle" src="https://github.com/user-attachments/assets/0546970a-e24e-4e15-a764-d548291eb623" /> `gopls` reports `expected ';', found 'EOF'` at `(0,0)..(0,0)` for the empty file. The diagnostic message is present in both builds; only the patched build paints the point squiggle. Sticky-header behavior was also verified with a deterministic stdio LSP. Before/after recordings are included in the review response below. ## Validation - `cargo test -p editor point_diagnostic` - `cargo test -p editor test_point_diagnostic_stays_in_edited_excerpt` - `cargo test -p editor test_point_diagnostics_follow_expanded_deletions` - `cargo test -p project test_empty_diagnostic_ranges` - `cargo test -p project test_diagnostic_range_spanning_line_terminator` - `cargo fmt --all -- --check` - `CCACHE_TEMPDIR=/tmp/zed-ccache-tmp ./script/clippy -p editor -p gpui -p multi_buffer -p project` - `git diff --check` - Manual before/after verification with gopls on an empty Go file - Manual before/after verification of a retained point diagnostic in a sticky header - Manual Fedora verification of physical overlap handling with `.ZedMono` and proportional Jomolhari text Regression coverage also includes retained point diagnostics across edited excerpt boundaries and expanded deleted diff hunks at the beginning, middle, and EOF, including an empty live buffer, plus painted-span severity arbitration for point-vs-range and point-vs-point overlaps. Release Notes: - Fixed missing editor underlines for language server diagnostics at positions without underlying text. - [GPUI] N/A --------- Co-authored-by: Kirill Bulatov <kirill@zed.dev> Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
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 discussion)
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
Zed source code is licensed primarily under GPL-3.0-or-later, with Apache-2.0 components where marked.
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.