Commit Graph
39151 Commits
Author SHA1 Message Date
Anthony Eid 3f16f7b908 lsp: Fix retained notification subscriptions leaking dropped language servers (#58866)
`Subscription::Notification` held a strong `Arc` to a language server's
entire notification handler map, while `Subscription::Io` already used a
`Weak`. Any subscription retained beyond the server's lifetime (e.g.
`copilot_log_subscription` in the LSP log store, which lives until the
project is closed) kept **every** handler on the dead server alive —
along with everything those closures capture, including
`Arc<CachedLspAdapter>` and `LspAdapterDelegate`s that pin full worktree
snapshots. Each server restart while such a subscription existed leaked
one server generation; on large worktrees that's tens of MB per restart.

The fix changes `Subscription::Notification` to hold a `Weak` reference,
matching the `Io` variant. Dropping a subscription still deregisters its
handler when the server is alive; if the server is already gone, there
is nothing left to clean up.

Also adds a regression test
(`test_subscription_leaks_handlers_after_server_drop`) to prevent this
from happening again

Helps with #58190 and #31461 (long-running memory growth involving
language servers), though it likely isn't the whole story for either,
the unbounded outbound message channel in `crates/lsp/src/lsp.rs`
remains a separate suspect for the extreme growth in #58190.

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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed a memory leak where restarting a language server could leak
memory if its notification subscriptions were still retained (e.g. while
the LSP log view was tracking it).
2026-06-08 21:24:36 +00:00
Anthony Eid 7f6f93c089 lsp: Bound the incoming language server message queue (#58867)
The background task reading a language server's stdout pushed every
parsed message into an unbounded channel consumed on the foreground
thread. If the main thread stalled while a server kept emitting
notifications, messages accumulated at wire speed with no limit —
matching the report in #58190 of 391 GB of memory growth during a
multi-hour hang with a chatty server.

This bounds the queue at 128 messages. When full, the reader stops
reading the server's stdout, so the OS pipe applies back pressure to the
server instead of Zed buffering its output in memory. No messages are
dropped, and healthy operation is unaffected. In flight client requests
behind a full queue fail via their existing background executor
timeouts.

Adds a regression test that wedges the consumer, asserts the queue stays
bounded, then drains it and asserts no messages were lost.

Helps with #58190 and may also help with #31461.

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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- lsp: Improve Zed's memory usage when LSP's emitted messages faster
than the foreground thread can handle them
2026-06-08 21:23:54 +00:00
Miguel Raz Guzmán Macedo 78658778a2 Use unstable sorts if deduplicating (#58751)
# Impact

Recent Project picker, `find all references`, the sidebar's
`rebuild_contents` might get a slight speed boost.

# Reasoning

Unstable sort variants

https://doc.rust-lang.org/stable/std/primitive.slice.html#method.sort_unstable
are non-allocating but potentially destructive. Since we're
deduplicating elements anyways, use the unstable variant.

This call will use ipnsort


https://github.com/Voultapher/sort-research-rs/blob/main/writeup/unreasonable/text.md#various-generic-algorithms

I expect the speedups to be at least 30%, though it's highly input
dependent.

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

Release Notes:

- N/A
2026-06-08 19:47:30 +00:00
Tom PlancheandCole Miller cc105a4459 git_ui: Add Add to .git/info/exclude option to context menus (#57044)
This is an unsolicited contribution, I hope that's ok. The feature is
small and I didn't want to open a discussion just for this.

There was no way to write to `.git/info/exclude` from Zed, so I added
one.

The "Add to .gitignore" action in the project panel and git panel
context menus is now grouped under a "Git" submenu, with a new "Add to
.git/info/exclude" action next to it.

Both actions:

- skip the write if the pattern is already there
- make sure there's a trailing newline
- show an error toast if something goes wrong
- fail gracefully on remote repositories

In the git panel both entries are disabled unless the file is untracked,
same as the gitignore action was before.

The write logic is shared via a small private helper, covered by two
unit tests.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [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

Release Notes:

- Added `Add to .git/info/exclude` option under a new `Git` submenu in
the project panel and git panel context menus, alongside the existing
`Add to .gitignore` action.

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2026-06-08 19:37:22 +00:00
Albert Bogusz 300fde7b70 Fix stale Git UI on reftable repositories on Linux (#58719)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] 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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

The non-recursive Linux watcher causes subdirectories inside `.git/` to
need explicit watching. For repos using the reftable backend, all ref
data lives in `.git/reftable/`. Operations in the UI like uncommitting
and creating new branches only modify refs inside `.git/reftable`
without changing `.git/HEAD`'s contents, so no inotify event fires on
`.git/` itself and the git UI never refreshes.

Essentially all this change does is check if `.git/reftable/` exists and
if it does, add it to the watcher. On the recursive macOS/Windows
watchers, `FsWatcher::add` returns early safely so this *should* not be
a performance loss apart from the brief lookup.

Release Notes:

- Fixed Git UI not refreshing on Linux for repositories using the
reftable backend.
2026-06-08 18:37:40 +00:00
Danilo Leal 7eda38207a Include icon guidelines in PR templates and contribution docs (#58855)
Release Notes:

- N/A
2026-06-08 17:42:34 +00:00
Smit Barmase a1a66114e9 git_ui: Fix panic when splitting a pane containing a commit view (#58853)
Closes FR-65

Release Notes:

- Fixed a crash when splitting a pane containing a commit view.
2026-06-08 17:33:04 +00:00
Danilo Leal 37392b6aca Fix Sourcehut icon SVG (#58852)
Follow up to https://github.com/zed-industries/zed/pull/58668 — the
previous PR wasn't following the icon design guidelines.

Release Notes:

- N/A
2026-06-08 17:22:53 +00:00
Danilo LealandMartin Ye e7edca8fd0 Improve warning display UI related to skills (#58838)
This PR tackles how we communicate errors/warnings relative to skills.
It touches three major surfaces: callouts in the thread view, menu items
in the completion menu, and settings UI. These are all the places where
we display something to tell the user a skill might have a problem.

In the settings UI, we now clamp the skill description to five lines.
And if there's a warning, we show the warning icon and the description
in a tooltip when hovering it:

<img width="600" alt="Screenshot 2026-06-08 at 10  51@2x"
src="https://github.com/user-attachments/assets/1a1233b0-c24a-4082-9fe6-2ab1d00ba9fd"
/>

In the thread view, we display callouts with the warnings. I simplified
the long-description one specifically given we can click on each skill
item right there, so no need for a "manage global skills" button or
descriptions in each item:

<img width="600" alt="Screenshot 2026-06-08 at 10  52@2x"
src="https://github.com/user-attachments/assets/4b9aad23-7362-40cd-8ab5-6dfceb46badd"
/>

In the code completion menu, I removed the icon that appeared at the far
right and instead added the ability for it to render a colored warning
icon instead of the icon it'd already display in the left; I think this
simplifies it nicely:

<img width="350" alt="Screenshot 2026-06-08 at 10  53@2x"
src="https://github.com/user-attachments/assets/8d0c731a-31a0-4d30-abab-1eb40f61031e"
/>


Release Notes:

- Agent: Improved how we communicate problems relative to skills, in
both the agent panel and the settings UI.

---------

Co-authored-by: Martin Ye <martin@zed.dev>
2026-06-08 15:46:15 +00:00
Lukas Wirth b14229f1a0 Fix TestScheduler::spawn_dedicated leaking due to cycle (#58802)
Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-08 15:44:17 +00:00
Albert BoguszandSmit Barmase 112d16057c Fix error prompt darkened background exceeding window boundaries on Linux (#57608)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] 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)
- [ ] Tests cover the new/changed behavior (visual difference only)
- [x] Performance impact has been considered and is acceptable

I was unable to find a specific issue or PR that mentions this.

As Linux installations always use built-in prompts and ignore the `Use
System Prompts` setting (as far as I'm aware) all users using Zed (with
client-side decorations) are affected. The darkened prompt backdrop was
drawn across the full window boundary, including the transparent
decoration/shadow inset, causing it to overlap.

This PR fixes the backdrop to respect the client-side decoration inset
and only applies rounded corners on non-tiled edges. Tiled edges remain
flush, matching the rest of the client-side window decoration behavior.
I've verified it works on Wayland, X11 and causes no regressions on
macOS or Windows (with `Use System Prompts` off).

Notice the screenshots below on a white background showing the before
and after, where the faint overlap is shown broken and fixed (sorry if
you have to squint).

Before:


![Before](https://github.com/user-attachments/assets/be12fbe9-1ad9-4282-a333-0d9d6ae162d5)

After:


![After](https://github.com/user-attachments/assets/75988dc8-2e45-4214-bf14-e999d7b9e996)

Release Notes:

- Fixed prompt darkened backdrop/background rendering outside
client-decorated window boundaries on Linux.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-06-08 14:59:39 +00:00
MartinYe1234andDanilo Leal 4eebf3fdbc settings_ui: Move skills management into settings UI (#58701)
Closes AI-344
Closes AI-342

Moves agent skills management out of the agent panel and into the
settings UI. The skill creator (previously its own crate) now lives in
`settings_ui` as a settings page, alongside the skills setup page. The
agent panel's ellipsis menu now links to the settings page instead of
hosting skill management directly.

Release Notes:

- Improved agent skills management by moving it into the settings UI

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-06-08 14:57:47 +00:00
Albert BoguszandDanilo Leal 1d1a4bee34 Change "Ok" to "OK" in UI (#58744)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] 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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #58543 and extends to all instances of "Ok" button labels.

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-06-08 14:48:37 +00:00
Finn Eitreim e40e7e8b05 outline: Switch the outline search to use fuzzy_nucleo (#56477)
Nucleo tracking issue:
https://github.com/zed-industries/zed/issues/55872

This PR switches the outline picker to use `fuzzy_nucleo`. 

with that I refactored the outline fuzzy picking to take advantage of
nucleo and its multi-atom query support. The previous implementation had
a lot going on specifically to work around the lack of multiple atoms,
basically taking matters into its own hands to accomplish the same goals
within the constraints it had.

Instead of having two lists of candidates that we have to run the query
against, we just run a single query and take advantage of the fact that
nucleo chooses the matches that are the furtherest towards the end of
the haystack to implement the same ancestor/leaf filtering. It retains
the leaf only matching on single atom queries.

video:


https://github.com/user-attachments/assets/64baa8d7-fd77-452c-86d1-e08561422d85

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



Release Notes:

- outline: switch to fuzzy_nucleo
2026-06-08 14:41:04 +00:00
Marshall Bowers 2ee00ba004 collab: Update test database schema (#58670)
This PR updates the database schema for Collab tests.

The corresponding database schema migration has been created in the
Cloud repo and applied to the production database.

Release Notes:

- N/A
2026-06-08 13:49:13 +00:00
Ben Kunkle f87bcfa4a5 ep: Disable diagnostic based jumps (#58832)
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 #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-08 13:11:17 +00:00
Ben Kunkle bebb687f60 ep: Show empty predictions in rate predictions modal (#58829)
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 #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-08 13:08:35 +00:00
Smit Barmase bda5ac3626 linux: Fix Wayland clipboard reads blocking indefinitely (#58826)
Closes FR-44

Unlike X11, where Zed already times out clipboard reads, on Wayland we
had no timeout at all. We read the clipboard from a pipe the source app
writes into, and we were doing a blocking `read_to_end` on it. So if the
other app opened the pipe but never wrote anything, or stalled partway
through, the read would block forever and hang Zed.

This PR replaces it with a non-blocking read driven by `poll` with a 4s
timeout, so:

- a stalled writer fails cleanly instead of freezing us.
- a slow writer that's still making progress on a large payload keeps
working.

This roughly mirrors what the X11 path already does. I have tested
pasting text, large image, drag-n-drop, etc cases.

To Reproduce:

1. Copy text from a web page in Firefox.
2. `kill -STOP "$(pgrep -o firefox)"`
3. Paste into Zed.

Zed hangs indefinitely.

<img width="400"
src="https://github.com/user-attachments/assets/532d1c55-1500-4143-8227-127e0024efba"
/>


Release Notes:

- Fixed a freeze on Linux Wayland when reading the clipboard from a slow
or unresponsive application.
2026-06-08 12:23:04 +00:00
Lukas Wirth f3b6eea689 Remove accidentally committed empty file (#58825)
This got produced by verifiying ssh askpass things a last time before
merging which with a stale cli exe piped into the prompt as a filename
...

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-08 11:44:38 +00:00
Ben Brandt f8226fd1eb agent: Remove experimental plan and title agent tools (#58824)
Neither really panned out, removing for now.

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

Release Notes:

- N/A
2026-06-08 11:39:49 +00:00
Yara 🏳️‍⚧️ ea50042f70 Fix profiler breaking concurrent tests (#58813)
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 #58699

Release Notes:

- N/A
2026-06-08 10:07:26 +00:00
Zaenalos 2b2536de0f Fix SSH askpass on Windows by invoking cli.exe directly (#52491)
On Windows, Zed generated a .ps1 askpass script and set **SSH_ASKPASS**
to 'powershell.exe -ExecutionPolicy Bypass -File ...'. SSH calls exec()
on SSH_ASKPASS which cannot exec a command string, causing:

error: ssh_askpass: exec(powershell.exe ...): No such file or directory

Fix by pointing **SSH_ASKPASS** directly to cli.exe and passing the
socket path via **ZED_ASKPASS_SOCKET** env var, which cli.exe reads
before clap parses arguments.

---
> Compiling Zed almost blew up my computer.
---

Related #29048 

Release Notes:

- Fixed some ssh issues on windows that prevented from connecting to a
remote
2026-06-08 09:37:00 +00:00
Xin ZhaoandLukas Wirth 4b974147f2 auto_update: Offload update installation to background thread (#58767)
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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #55279

When auto-updating, Zed first downloads the update and then performs the
installation. On each platform, this installation phase runs external
commands that spawn new processes. These operations can block the thread
they run on—especially under heavy system load or when
security/antivirus software is active. (An analysis of the blockages on
Windows is documented in
https://github.com/zed-industries/zed/issues/55279#issuecomment-4638072228).

This PR moves the installation process to a background thread. This
ensures that even if process spawning block, the main UI thread remains
responsive.

Release Notes:

- Fixed a UI freeze that could occur when installing auto-updates.

---------

Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
2026-06-08 09:27:15 +00:00
Veesh GoldmanandClaude Opus 4.8 88e5c6d2fa agent: Don't offer feature-flag-gated tools in agent profiles (#58581)
Closes #56778

## Problem

The agent-profile tool configuration lists every built-in tool from
`agent::ALL_TOOL_NAMES`, filtering only by provider support
(`crates/agent_ui/src/agent_configuration/manage_profiles_modal.rs`).
But `Thread::enabled_tools` additionally drops feature-flag-gated tools
before they reach the model — the LSP tools (`go_to_definition`,
`find_references`, `get_code_actions`, `apply_code_action`) behind
`LspToolFeatureFlag`, `rename_symbol` behind `RenameToolFeatureFlag`,
and `create_thread` / `list_agents_and_models` / `update_plan` /
`update_title` behind their own flags.

The result: when a flag is off, a user can enable the tool in a profile,
but the agent never receives it. The picker and the runtime gate
disagreed.

## Fix

Extract the feature-flag gating into a single shared predicate,
`agent::tool_feature_flag_enabled`, and route **both**
`Thread::enabled_tools` and the profile tool picker through it. The
configuration UI can no longer offer a tool the agent would silently
drop, and the two call sites can't drift apart. Also updated the "silent
drop gates" comment in `tools.rs` to document this third gate.

This matches the behavior requested in the issue (don't list tools that
can't be used). The alternative — showing them disabled with an
explanation — is also possible; happy to switch if preferred.

## Testing

- Added `lsp_tools_are_gated_by_their_feature_flag` in
`crates/agent/src/tools.rs`.
- `cargo test -p agent`, `cargo clippy -p agent`, and `cargo fmt` are
clean.
- (`agent_ui` doesn't build in my local environment due to an unrelated
`webrtc-sys` C++ toolchain issue; the `agent_ui` change is a one-line
filter addition mirroring the adjacent provider-support check — relying
on CI to confirm.)

Release Notes:

- Fixed feature-flag-gated tools (such as the LSP tools) being listed in
agent profile configuration when they could not actually be used by the
agent.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 09:17:11 +00:00
Lukas Wirth 55d5713de9 remote: Do not swallow ssh errors (#58780)
Release Notes:

- Fixed non-descriptive error messages when remote agent processed
disconnected
2026-06-08 08:48:09 +00:00
Albert Bogusz f99fe5d8c2 Use SHORT_SHA_LENGTH for all shortened commit SHAs (#58741)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] 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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Fixes hardcoded SHA lengths not using the `SHORT_SHA_LENGTH` constant.

Release Notes:

- Reduced short commit SHAs in blame and commit tooltips from 8 to 7 -
consistent with the graph and history views.
2026-06-08 06:38:39 +00:00
zed-zippy[bot] 3f5705b985 extension_ci: Bump extension CLI version to 9ee3c50 (#58785)
This PR bumps the extension CLI version used in the extension workflows
to `9ee3c503a4bbbc6b4a0f8a789acca4871d773223`.

Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-06-07 17:04:14 +00:00
215ca2fb0b Typed workspace errors (#57649)
This migrates the `Workspace::show_error` method to take a generic type
that implements `WorkspaceError` instead. That trait containts methods
to show a proper error message but most importantly means to help with
providing actions given certain errors.

The intention for this is rather easy: Whenever we show an error to the
user on the workspace level, that error should be
- actionable to a degree, even if that is only opening logs or whatnot
- show a message that is understandable to the user
- for not-too-critical errors, should hide after a certain delay and not
force the user to dismiss it using their mouse.


For now, there exist trait implementations for string error types and
anyhow errors. The long term goal here is to get rid of these altogether
and migrate everything to be strongly typed and especially actionable
instead.

Self-Review Checklist:

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

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-06-07 16:55:18 +00:00
Finn Evers 9ee3c503a4 extension: Perform compilation tasks in parallel (#55160)
This will improve local dev installation times as well as CI times by a
lot (I measured it once and for some extensions, it might save us up to
60% of CI time. It will similarly help locally).

I also moved the debug adapter schema validation to the other
validations, as it felt it makes more sense to check there as opposed to
doing this during the compilation step.

Release Notes:

- Improved dev extension installation times for language extensions with
multiple grammars or language servers.
2026-06-07 16:39:58 +00:00
Vlad Ionescu 5c1f18bceb opencode: Model updates (#58743)
OpenCode models updates (delayed since I was super-busy the past 2 weeks
and nobody else opened up a PR):

**Free**:
- added MiniMax M3 Free as per
[models.dev](https://github.com/anomalyco/models.dev/blob/f753ddacdbab785c87f4fceb3187d6ceb9790966/providers/opencode/models/minimax-m3-free.toml)
and [docs](https://opencode.ai/docs/zen/). Seeing how MiniMax M2.5 was a
long-term Free model, I am also assuming the same will be true for M3 🤷
Tested and confirmed working with a simple "_rename this variable for
me. add a function. delete the function_" test
- added Nemotron 3 Ultra Free as per
[models.dev](https://github.com/anomalyco/models.dev/blob/f753ddacdbab785c87f4fceb3187d6ceb9790966/providers/opencode/models/nemotron-3-ultra-free.toml)
and [docs](https://opencode.ai/docs/zen/), with 3 reasoning levels
discovered manually from the OpenCode CLI. Tested and confirmed working
with a simple "_rename this variable for me. add a function. delete the
function_" test, both on `low` and `high` reasoning levels
- removed Nemotron 3 Super Free as per
[models.dev](https://github.com/anomalyco/models.dev/commit/72fc81a4daf22bccd14b383971e8bc92bbe2e64e)

**Go**:
- added MiniMax M3 as per
[models.dev](https://github.com/anomalyco/models.dev/blob/f753ddacdbab785c87f4fceb3187d6ceb9790966/providers/opencode-go/models/minimax-m3.toml).
Tested and confirmed working with a simple "_rename this variable for
me. add a function. delete the function_" test
- added Qwen 3.7 Plus as per
[models.dev](https://github.com/anomalyco/models.dev/blob/f753ddacdbab785c87f4fceb3187d6ceb9790966/providers/opencode-go/models/qwen3.7-plus.toml).
Tested and confirmed working with a simple "_rename this variable for
me. add a function. delete the function_" test
- updated token counts for Qwen 3.6 Plus as per
https://github.com/anomalyco/models.dev/commit/350704d76271d3a166d85adc646006ec10bdc42c
- removed Qwen 3.5 Plus as per
[models.dev](https://github.com/anomalyco/models.dev/commit/c7af5ba9bee373a5a90d52b24d81276d778b48e2)
(but not from Zen where [it is still
valid](https://github.com/anomalyco/models.dev/blob/e524b01b9a8f593838f9d36469f0c5087ae2cf34/providers/opencode/models/qwen3.5-plus.toml))

**Zen**:
- added DeepSeek V4 Flash as per
[models.dev](https://github.com/anomalyco/models.dev/blob/f753ddacdbab785c87f4fceb3187d6ceb9790966/providers/opencode/models/deepseek-v4-flash.toml)
and [docs](https://opencode.ai/docs/zen/). Not tested as I don't have a
Zen subscription and I am stubbornly refusing to get one
- added MiniMax M2.7 which was mistakenly marked as Go-only. Not tested
as I don't have a Zen subscription and I am stubbornly refusing to get
one

------

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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Agent: Updated OpenCode models (added MiniMax M3, Qwen 3.7 Plus,
DeepSeek V4 Flash, MiniMax M3 Free, and Nemotron 3 Ultra Free; removed
Nemotron 3 Super Free, Qwen 3.5 Plus; updated MiniMax M2.7, MiniMax
M2.5, Qwen 3.6 Plus)
2026-06-06 20:28:26 +00:00
Lukas Wirth 3cfcd69738 Stream git blame parsing (#58733)
Parse git blame stdout incrementally while the process is still running
instead of waiting for child output to buffer the entire command result.

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-06 18:36:07 +00:00
feeiyu 137e677a05 Fix Wayland IME handling with multiple windows (#58712)
Self-Review Checklist:

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

Fix an issue introduced by PR #58237 where IME could not be enabled when
multiple windows were open.
The fix ensures that `update_ime_enabled` only updates IME state for the
active window.

Release Notes:

- N/A
2026-06-06 09:16:05 +00:00
David Manca 6e9465a428 Add Sourcehut icon for Sourcehut hosting provider (#58668)
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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Improves https://github.com/zed-industries/zed/pull/57500 by including
an icon for the SourceHut remote. SourceHut provides the official icon
as a public domain licensed icon. I additionally got a permission from
Drew DeVault.

Amends the PR: https://github.com/zed-industries/zed/pull/57500

<img width="1407" height="444" alt="image"
src="https://github.com/user-attachments/assets/81a156f1-d94d-4c01-98b8-40e787e93112"
/>


No AI was used in the development of this feature, as is declared by
signing off the commits.

Release Notes:

- Added the SourceHut remote icon

Signed-off-by: medzernik <medzernik@medzernik.dev>
2026-06-06 00:23:38 +00:00
Xin Zhao aeb8c1da93 Clarify panel dock defaults depend on layout in docs (#58654)
Self-Review Checklist:

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

Please check
https://github.com/zed-industries/zed/issues/56277#issuecomment-4417185748
for more context.

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-06 00:14:13 +00:00
Ben Kunkle 0c660d0cb4 worktree: Don't eagerly remove watchers (#58692)
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 #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-05 23:48:20 +00:00
Cole Miller e5c370b3b2 git: Fix add safe directory button doing nothing (#58705)
We had a nested spawn that was disguising the fact that the actual
`git_config` task was being dropped immediately instead of detached.
This only seems to cause problems in release builds due to timing
issues.

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

Release Notes:

- Fixed a bug where clicking the button to trust a git repository would
do nothing.
2026-06-05 23:14:26 +00:00
zed-zippy[bot] 9709caec23 glsl: Bump to v0.2.4 (#58704)
This PR bumps the version of the GLSL extension to v0.2.4.

Release Notes:

- N/A

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-06-05 23:12:31 +00:00
Helmer Nordström 16991c9a29 Add indentation rules for GLSL syntax (#58520)
Add C-Style indentation rules for GLSL. By adding an indents.scm file
for GLSL we get the same automatic indentation as we have for other
languages.

Release Notes:

- N/A
2026-06-05 22:51:31 +00:00
Alex Lachance 3c0f5a04a6 python: Fix Python exception highlighting (#58176)
In the current Python Tree-sitter `highlights.scm`, exception
(https://docs.python.org/3/library/exceptions.html) are highlighted
under `@type.class` which is inconsistent compared to other editors (VS
Code, Neovim, Helix).

This PR adds `#any-of?` with a list of python's exceptions and highlight
them under `@type.builtin`.

| Before | After |
|
:---------------------------------------------------------------------------------------------------------------------------------:
|
:--------------------------------------------------------------------------------------------------------------------------------:
|
| <img width="1237" height="1160" alt="image"
src="https://github.com/user-attachments/assets/05e1ae34-7637-413a-9785-ad696c2bf751"
/> | <img width="1237" height="1154" alt="image"
src="https://github.com/user-attachments/assets/105c61ca-b6a7-4c26-acc8-3e300f044510"
/> |


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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added the ability to stylize builtin python exceptions and warnings
using the `type.class.builtin` syntax capture.
2026-06-05 22:49:28 +00:00
Danilo Leal 4278e5296d sidebar: Hide collapse affordances in project header upon searching (#58696)
Closes AI-358

This PR hides the chevron and removes hover styles from the project
header when there is an active search, given groups can't be collapsed
while that's happening. We could allow it, but I think it's not super
worth it; this feels like like a pragmatic move.

Release Notes:

- Sidebar: Fixed a bug where affordances to collapse the project header
would appear when searching.
2026-06-05 21:14:53 +00:00
MartinYe1234andDanilo Leal 104d6e46f8 settings_ui: Allow changing settings scope inside sub-pages (#58698)
The settings UI previously required selecting a settings scope (User /
project) before entering a sub-page; the scope picker disappeared once
inside. This makes the scope switchable from within sub-pages.

- The scope segment of the sub-page breadcrumb (e.g. "User / AI / Agent
Configuration / Skills") is now a dropdown listing all scopes the
sub-page supports (filtered by the sub-page's file mask, intersected
across the sub-page stack). Selecting a scope re-renders the sub-page in
place — e.g. the Skills page swaps between global and project-local
skills.
- The sub-page stack is preserved across scope changes when every
sub-page in it is valid in the new scope; otherwise it falls back to the
regular navigation behavior.
- Sub-pages that only support one scope (Tool Permissions, Configure
Providers, Feature Flags) keep the static label.
- Entering a sub-page now clears the settings search bar so sub-pages
show all their items (settings deep links that prefill the search are
unaffected).

Closes AI-343

Release Notes:

- Improved the settings window: sub-pages such as Skills and
per-language settings now have a scope picker in the breadcrumb, so you
can switch between User and project settings without leaving the page.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-06-05 21:13:24 +00:00
6d68395c49 agent: Warn about long skill descriptions (#58356)
Closes #58046 
Closes AI-353

Skills with descriptions over the 1024-byte limit now load with a
warning instead of failing. The warning appears in the thread footer
with clickable skill file rows, and the skill picker keeps the skill
icon while showing a right-aligned warning badge whose hover text
explains the issue.

Warning for single out-of-spec skill
<img width="2790" height="870" alt="image"
src="https://github.com/user-attachments/assets/f454b55a-8e05-438e-b4ff-356259ff6843"
/>

Warning for multiple out-of-spec skills
<img width="2796" height="646" alt="image"
src="https://github.com/user-attachments/assets/a0808cdd-4857-4a6b-a26e-15156afbffe9"
/>

Skill selection popup
<img width="1234" height="1118" alt="image"
src="https://github.com/user-attachments/assets/5bb463f6-7adb-4e39-8522-e322bf078aff"
/>

Skill management in settings
<img width="1768" height="1390" alt="image"
src="https://github.com/user-attachments/assets/85c6b179-e268-4518-8ca7-c73b55f92355"
/>


Release Notes:

- Allow loading skills whose descriptions exceed the 1024-byte limit by
showing warnings instead of failing to load them.

---------

Co-authored-by: Martin Ye <martin@zed.dev>
Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-06-05 19:46:05 +00:00
Danilo Leal bd1f7378c5 title_bar: Improve design for call controls (#58691)
For the longest time, we've had a labeled "Share" button on the title
bar whenever you're in a call. However, it was extremely easy to click
that button thinking you'd be sharing _your screen_ instead of your
project. At the end of the day, there wasn't any specific cue that'd
allow you to know what you'd be sharing. This is why people just assumed
you'd share the screen, which is arguably way more common than sharing
the project. We've seen users bump into this confusion countless times,
and this also even happens to us (the whole Zed staff) weekly whenever
we're in meetings.

So, this PR changes that button to be an icon button instead, using a
folder icon to better communicate it means sharing the project. I also
took advantage of the opportunity to change the approach we use for
adding these buttons, using `when` instead of `children.push`; I think
the former is just easier to understand, allowing to more easily picture
the UI in your (my) head. Lastly, also improved what we display in the
tooltip for the project share button, by showing the names of all
projects you'll be sharing, as well as the tooltip that displayed call
diagnostics.

| Before | After |
|--------|--------|
| <img width="778" height="360" alt="Screenshot 2026-06-05 at 3  48
2@2x"
src="https://github.com/user-attachments/assets/363593fb-79f8-42e9-83b9-345bc731846f"
/> | <img width="778" height="360" alt="Screenshot 2026-06-05 at 3  48
3@2x"
src="https://github.com/user-attachments/assets/32afc412-a1fb-45a4-a19e-74e4923c0c8b"
/> |

Release Notes:

- Improved call controls design, making it clearer what button shares
_the project_ vs. _the screen_.
2026-06-05 19:30:47 +00:00
Piotr OsiewiczandClaude Opus 4.8 ab2683b04c text: Preserve structural sharing when rebuilding the fragment tree (#58681)
## Context

`apply_remote_edit` and `apply_local_edit` rebuild the fragment
`SumTree` through `FragmentBuilder`. Since #51941, the builder collapsed
the entire tree into a flat `Vec<Fragment>` (cloning every fragment) and
rebuilt a fresh tree from scratch on every call. The new tree shared no
nodes with the previous one, so each edit cost O(N) in the *total*
number of fragments: clone all fragments, allocate an entirely new tree,
and then free the whole previous tree on assignment — the last part
showing up as a large amount of time spent dropping `SumTree`s.

That batching was a deliberate win for the bulk `replace_all` path
(#51941, one `edit()` carrying millions of ranges), but it penalizes
every other caller — most notably `apply_remote_edit`, which runs once
per op in a loop in `apply_ops` and so rebuilt the whole tree per remote
operation.

## This change

Make `FragmentBuilder` chunk-based. Appended slices are kept as intact
`SumTree` subtrees, so they keep sharing nodes with the previous tree;
only individually pushed fragments are batched into `Vec`s.
`to_sum_tree` appends the shared subtrees (touching just the right
spine) and builds the loose runs in one pass, parallelizing the large
ones.

Net effect:
- Small edits on large/heavily-fragmented buffers (the
`apply_remote_edit` collaborative path) go back to O(edited + log N)
with a cheap drop, instead of O(total fragments).
- The bulk `replace_all` path keeps its batched build and is not
regressed.

## Benchmarks

Using the file from #38927 (619 MB CSV, 10,325,246 matches of `"` →
`""`), `release-fast`:

| Case | flatten (#51941) | this PR |
|---|---|---|
| `replace_all` (all matches) | 50.70 s | 45.16 s |
| replace 1 match (`--single`) | 16.0 ms | 16.0 ms |

`replace_all` is ~11% faster and not regressed. The
single-match-on-a-freshly-loaded-file case is unchanged, because a fresh
`Buffer::local` is barely fragmented, so even the from-scratch rebuild
is cheap there; the structural-sharing win is on heavily-fragmented
buffers receiving small edits.

The `--single` flag added to `editor_benchmarks` makes the latter case
measurable.

Release Notes:

- Improved the performance of applying edits to large buffers

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-05 19:24:28 +00:00
Lukas WirthandEric Holk a32999e00b workspace: Update window title when switching active workspace (#58401)
In a multi-workspace window several workspaces share one platform
window. Switching the active workspace did not update the window title
or edited indicator, and background workspaces could clobber the active
workspace's title via their still-live project/item event subscriptions.

Track the active workspace id in a shared Rc<Cell<EntityId>> owned by
the MultiWorkspace and read by each member workspace, so a workspace
only writes the shared window's title/edited state when it is the active
one. The newly active workspace re-applies its title and edited
indicator on activation. We use a Rc-cell here to avoid double lease
issues as we cannot tell whether we are inside a running MultiWorkspace
lease or not in the given codepaths.

Release Notes:

- Fixed the window title not updating when switching between workspaces
in a multi-workspace window

---------

Co-authored-by: Eric Holk <eric@theincredibleholk.org>
2026-06-05 19:10:08 +00:00
MartinYe1234 1cecd7d66a Fix agent permission row flicker when scrolled away from a tall plan (#58689)
When a pending tool call awaiting permission contains tall content (e.g.
a full plan in Claude Code plan mode) and the inline prompt is scrolled
out of view, the floating awaiting-permission row embeds that content
and can grow to consume the entire panel, squeezing the conversation
list to zero height. `ListState::item_is_above_viewport` /
`item_is_below_viewport` returned `None` for a zero-height viewport, so
the row's visibility decision oscillated from frame to frame, flickering
between the conversation and the permission prompt and making the thread
unusable.

This PR fixes the root cause and hardens the UI:

- `gpui`: `item_is_above_viewport` / `item_is_below_viewport` now answer
definitively from the last layout bounds even when the viewport is
zero-height, so callers that size sibling UI based on these queries
can't oscillate. Adds a regression test.
- `agent_ui`: adds a `Floating` tool call layout used by the
awaiting-permission row that caps the embedded tool call content with a
scrollable max height, so the row can never crowd the conversation list
out of view while keeping the permission buttons visible. Adds an
integration test that drives real window draws and asserts the row's
visibility is stable across frames.

Closes AI-372

Closes https://github.com/zed-industries/zed/issues/58564

Release Notes:

- Fixed the agent panel flickering and becoming unusable when a
permission prompt with tall content (such as a plan awaiting approval)
was scrolled out of view.
2026-06-05 18:52:11 +00:00
Anthony Eid f1268a1233 Fix split diff stale scroll anchor crash (#58688)
This crash occurred when the left hand side (LHS) editor in the split
diff retained a stale shared scroll handler after the split editor
unsplits. I added an invariant check to our randomized companion display
map tests to prevent regressions here and explicitly make LHS editor set
a native scroll anchor when unsplitting.

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

Release Notes:

- Fix crash that could occur when unsplitting a side by side diff view
2026-06-05 18:25:37 +00:00
Ben Brandt 56b71271c4 acp: Enable ACP session usage and deletion features (#58680)
Stabilizes context windows + persistent session/delete for acp agents
that support them

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

Release Notes:

- acp: Show context window usage and cost metrics for external agents
that support it.
- acp: Persist session deletion from history for external agents that
support it.
2026-06-05 17:52:45 +00:00
Lukas Wirth f7dc726209 sidebar: Debounce Sidebar::update_entries (#57803)
Follow up on https://github.com/zed-industries/zed/pull/57717
Release Notes:

- N/A or Added/Fixed/Improved ...
2026-06-05 16:57:00 +00:00
Mikhail PertsevandTom Houlé befa775029 helix: Fix line selection after undoing delete (#55365)
Closes #55170

Fixes Helix mode undo selection history after `d` deletes the character
under an empty cursor. Previously, `d` temporarily expanded the cursor
to a one-character selection before deleting, and undo restored that
temporary selection. When the deleted character was a newline, pressing
`x` after undo selected additional line which was wrong.

This preserves the original Helix selection as the undo-restored
selection while keeping the existing delete behavior unchanged.

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

Release Notes:

- Fixed Helix mode selecting one extra line after undoing a newline
delete

Co-authored-by: Tom Houlé <13155277+tomhoule@users.noreply.github.com>
2026-06-05 16:50:02 +00:00