Restarting an LSP from the picker drops the server's metadata (version, memory, "View Logs") even though the new server is healthy. Reproduces with `vtsls`, `eslint`, `rust-analyzer`, and others; `vlsls` doesn't. The button kept id-keyed state in [`health_statuses`](https://github.com/zed-industries/zed/blob/main/crates/language_tools/src/lsp_button.rs#L159) and [`servers_per_buffer_abs_path`](https://github.com/zed-industries/zed/blob/main/crates/language_tools/src/lsp_button.rs#L161), but never handled [`LspStoreEvent::LanguageServerRemoved`](https://github.com/zed-industries/zed/blob/main/crates/project/src/lsp_store.rs#L4066) — there was even a [stale TODO](https://github.com/zed-industries/zed/blob/main/crates/language_tools/src/lsp_button.rs#L860) claiming the event wasn't emitted (it's emitted from [five sites](https://github.com/zed-industries/zed/blob/main/crates/project/src/lsp_store.rs#L11190) in `lsp_store`). On restart the dead id lingered next to the new one in both maps, and rendering picked the wrong entry. Fix: handle `LanguageServerRemoved` and evict the dead id from both maps. `binary_statuses` is left alone — it's name-keyed and shared across restart cycles to drive the "Downloading… → Starting…" UX. The cleanup is extracted to `LanguageServers::remove_server` so it's directly unit-testable. Added four tests covering health eviction, per-buffer eviction with empty-entry pruning, `binary_statuses` preservation, and the full restart sequence. [PR #50417](https://github.com/zed-industries/zed/pull/50417) attempted this earlier with a `LanguageServerAdded` handler. @SomeoneToIgnore flagged that as the wrong hook ([buffer registration](https://github.com/zed-industries/zed/blob/main/crates/language_tools/src/lsp_button.rs#L919-L948) is what populates state, not startup) and asked for tests. Handling `LanguageServerRemoved` is a cleaner fit — it's the natural counterpart to registration, and it also fixes the related case where stopping a server (without restart) leaks state. ## Verification Reproduced on `main` and verified the fix on this branch with `vtsls` and `eslint` against a small TypeScript project. | Before restart | After restart on `main` (bug) | After restart on this branch (fix) | |---|---|---| | <img width="588" alt="vtsls row before restart — version, memory, View Logs all visible" src="https://github.com/user-attachments/assets/bdd2610b-cf8f-4ea1-bc45-f363b098c146" /> | <img width="536" alt="vtsls row after restart on main — metadata gone" src="https://github.com/user-attachments/assets/66b3eefd-f801-4bfd-8b80-5f0e20fb3bc6" /> | <img width="554" alt="vtsls row after restart on fix branch — metadata persists" src="https://github.com/user-attachments/assets/51d4df48-1223-4b21-856f-72d4c1eb2a6a" /> | Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] 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 Closes #53627 Release Notes: - Fixed missing language server metadata in the LSP menu after restart. </content> --------- Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> |
||
|---|---|---|
| .agents/skills | ||
| .cargo | ||
| .cloudflare | ||
| .config | ||
| .factory | ||
| .github | ||
| .zed | ||
| assets | ||
| ci | ||
| crates | ||
| docs | ||
| extensions | ||
| legal | ||
| nix | ||
| script | ||
| tooling | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .mailmap | ||
| .prettierrc | ||
| .rules | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| clippy.toml | ||
| CODE_OF_CONDUCT.md | ||
| compose.yml | ||
| CONTRIBUTING.md | ||
| debug.plist | ||
| default.nix | ||
| Dockerfile-collab | ||
| Dockerfile-collab.dockerignore | ||
| Dockerfile-cross.dockerignore | ||
| Dockerfile-distros | ||
| Dockerfile-distros.dockerignore | ||
| flake.lock | ||
| flake.nix | ||
| GEMINI.md | ||
| LICENSE-APACHE | ||
| LICENSE-GPL | ||
| livekit.yaml | ||
| lychee.toml | ||
| Procfile | ||
| Procfile.web | ||
| README.md | ||
| renovate.json | ||
| REVIEWERS.conl | ||
| rust-toolchain.toml | ||
| rustfmt.toml | ||
| shell.nix | ||
| typos.toml | ||
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.