Commit graph

37788 commits

Author SHA1 Message Date
Mikhail Pertsev
75deffd4f7
editor: Extract more git related stuff out of editor.rs (#56198)
cc @SomeoneToIgnore

## Summary

Follow-up to #56155. I extracted the remaining git related things (again
not all of them, leftovers are more tricky as there are git + fold +
some others things combined) into `git.rs`

We nod reached a good milestone, the `editor.rs` would be below 20k
lines 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-05-08 16:24:30 +00:00
Marshall Bowers
6b7d20efdb
collab: Route UserService::get_user_by_github_login through Cloud (#56190)
This PR makes it so we route the `UserService::get_user_by_github_login`
call through Cloud instead of hitting the database.

Closes CLO-743.

Release Notes:

- N/A
2026-05-08 16:21:09 +00:00
Agus Zubiaga
dc06395e73
markdown: Bump mermaid-rs-renderer to fix flowchart parser panic (#56199)
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

Bumps `mermaid-rs-renderer` to
`782b89a7da3f0e91e51f98d00a93acba679be6fb`, which picks up
[1jehuang/mermaid-rs-renderer#95](https://github.com/1jehuang/mermaid-rs-renderer/pull/95),
fixing a panic with partially typed mermaid.

Release Notes:

- Fixed a crash in markdown preview when a mermaid flowchart contained a
partially-typed parallelogram node like `A[/]` or `A[\]`.
2026-05-08 16:09:05 +00:00
Marshall Bowers
31661a8383
client: Rename UserId to LegacyUserId (#56185)
This PR renames the `UserId` type in the `client` crate to
`LegacyUserId`.

The `id` field on the `User` has also been renamed to `legacy_id`.

This is strictly a rename, no change in behavior.

Release Notes:

- N/A
2026-05-08 15:53:40 +00:00
Bennet Bo Fenner
b3c65f9410
bedrock: Always use 1M context window for anthropic models (#56195)
Closes #49617

Release Notes:

- bedrock: Always use 1M context windows for Anthropic models
2026-05-08 15:43:52 +00:00
Ben Kunkle
392961ed0d
Fix flaky terminal kill task test (#56194)
Failed CI run:
https://github.com/zed-industries/zed/actions/runs/25559568951/job/75027378760?pr=56181

test_kill_active_task_on_completed_task_is_noop was flaking on Linux.
It's sibling was just waiting 200ms for PTY events to be handled by
alacritty. This PR polls the PTY instead of waiting an arbitrary amount
of time

Release Notes:

- N/A
2026-05-08 15:32:59 +00:00
Smit Barmase
6151889ddf
markdown: Fix table header alignment and apply alignment to cell content (#56179)
Follow up: https://github.com/zed-industries/zed/pull/53465

For Markdown tables, headers are now always centered (ignoring column
alignment), matching standard Markdown rendering behavior. For HTML
tables, headers default to center but respect explicit `align`
attributes.

This also propagates alignment to paragraphs and headings inside table
cells, not just the cell container itself.

Release Notes:

- N/A
2026-05-08 15:24:45 +00:00
Lukas Wirth
b8c3167a9d
diagnostics: Always expand at least multibuffer_context_lines per diagnostic (#56172)
Otherwise we can sometimes end up with single line excerpts which looks
very off



Release Notes:

- Improved the minimum size of diagnostics pane excerpts
2026-05-08 14:18:44 +00:00
Teslim Olunlade
954ac0f3ca
Add conditional check for auto_discover in Ollama provider (#55999)
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 #55998

Release Notes:

- ollama: Fixed issue where specifying `auto_discover: false` would
still auto discover models
2026-05-08 14:17:59 +00:00
Marshall Bowers
4b23564f36
collab: Route get_users_by_ids through Cloud (#56105)
This PR makes it so we route the `UserService::get_users_by_ids` call
through Cloud instead of hitting the database.

We've introduced a new `CloudUserService` that will fetch the users from
Cloud using the internal API. Note that we've only implemented the
`get_users_by_ids` method on this service, as the endpoints for the
other methods don't yet exist.

We have also introduced a `TransitionalUserService` for the purposes of
gradually transitioning these calls over to Cloud. Right now it uses the
`CloudUserService` for the `get_users_by_ids` implementation, but then
uses the `DatabaseUserService` for the other methods.

Closes CLO-740.

Release Notes:

- N/A
2026-05-08 13:34:46 +00:00
Ben Kunkle
6bc4b4b7e4
Fix zeta2 prompt format selection (#55338)
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 https://github.com/zed-industries/zed/issues/52585

Release Notes:

- Fixed local zeta2 edit predictions using the wrong prompt format.
2026-05-08 13:19:33 +00:00
Ben Kunkle
f87f0c0e1d
fs: Don't treat watcher errors as reason to do rescans (#56165)
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 https://github.com/zed-industries/zed/issues/56064

This behavior regressed in
https://github.com/zed-industries/zed/pull/54481

Release Notes:

- Fixed an issue where broken symlinks, permission errors, or other fs
errors in watched directories could cause excessive CPU usage
2026-05-08 13:19:07 +00:00
Cameron Mcloughlin
7940ded92a
sidebar: Better search (#56166)
Makes the sidebar search case insensitive, and also require contiguous
matches. Also removes the duplicate logic for the sidebar and thread
history view

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-08 13:13:14 +00:00
Marshall Bowers
367db0706b
collab: Remove unused api_token field from Config (#56098)
This PR removes the `api_token` field from Collab's `Config`, as it is
no longer used.

Release Notes:

- N/A
2026-05-08 12:28:22 +00:00
Mikhail Pertsev
6aca6364fe
editor: Extract git and input out of editor.rs (#56155)
cc @SomeoneToIgnore

## Summary

Follow-up to https://github.com/zed-industries/zed/discussions/55352,
where the conclusion was to split `editor.rs` incrementally by topic
instead of all at once.

This mechanically extracts two editor topics into focused sibling
modules:

- `crates/editor/src/input.rs`
- `crates/editor/src/git.rs`

The git extraction is intentionally partial for now. I left a lot of
related parts because otherwise the diff was super huge (over 9K lines)
in the Github, so we can move those parts later in the follow-up PRs
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-05-08 12:01:43 +00:00
Bennet Bo Fenner
e78ddcac8d
agent: Improve UX when agent tries to edit unsaved buffer (#55655)
Before:

1. Agent tries to edit unsaved file
2. Tool call fails with error telling the agent to ask the user to save
or discard edits
3. User types save/restore
4. Agent uses save/restore tool


https://github.com/user-attachments/assets/c94dd361-e8e0-48ee-be31-da8afe594419

After:

1. Agent tries to edit unsaved file
2. User is prompted to save/restore file
3. User accepts/rejects or saves/discards file manually


https://github.com/user-attachments/assets/1d98a0c4-4420-4426-94f2-42355de230be

Release Notes:

- agent: Improved UX when agent tries to edit unsaved buffer

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-05-08 11:26:03 +00:00
Kirill Bulatov
c049193fd9
Make all status bar tools able to hide its button via UI (#54971)
Closes https://github.com/zed-industries/zed/discussions/53471

Adds a requirement on status bar items to provide a way to hide
themselves.

<img width="329" height="153" alt="image"
src="https://github.com/user-attachments/assets/b98ee5ba-a439-44d7-9ab5-f4511b66a574"
/>

<img width="464" height="40" alt="image"
src="https://github.com/user-attachments/assets/b41d9189-3475-4e61-b3a4-bc731dd52c53"
/>


Release Notes:

- Added a way to hide sidebar buttons
2026-05-08 10:36:03 +00:00
Kirill Bulatov
b270b1d63d
Fix resolved lens causing flickers (#56047)
Based on
https://github.com/zed-industries/zed/pull/54100#issuecomment-4394534078

* Adjusts the code lens display closer to what VSCode does: have blank
placeholders for the code lens need resolving.
Zed will remove them if resolve returns nothing, so some small amount of
jitter is still there.

* Also reworks LspStore layer to provide a simple resolve method,
without any ranges involved, grouping that logic in the editor itself.
This allows to process each resolve request separately, updating editor
blocks as soon as possible.

Before:


https://github.com/user-attachments/assets/d6759a90-0087-4658-abf8-8e2767bc63a2

After:


https://github.com/user-attachments/assets/cb8f976c-b3fc-4f66-bb9f-812108255c90


Release Notes:

- Fixed resolved lens causing flickers
2026-05-08 10:23:56 +00:00
Lukas Wirth
c8f0026867
gpui: Remove unsound await_on_background helper (#56132)
The function is unsound due to the classic fact that one can leak tasks,
sidestepping the blocking drop behavior resulting in a use after free.

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-08 09:30:34 +00:00
Gabriel Linder
e727080af2
Update Mistral provider docs following #55443 (#56133)
Update Mistral provider docs following #55443

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

Release Notes:

- N/A or Added/Fixed/Improved ...

Signed-off-by: Gabriel Linder <linder.gabriel@gmail.com>
2026-05-08 08:09:42 +00:00
Finn Evers
e1a46f9256
gpui: Use SharedString::new_static within From impls for ElementId where possible (#56139)
Horror of a PR title but could not think of anything better here.

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-05-08 08:06:44 +00:00
Joseph T. Lyons
6766514599
Improve auto watch (#56126)
This PR fixes a few bugs, updates some UI, and improves testing of auto
watch. It'll likely be easier to review commit by commit:

- Swapped the Copy Channel Link and Auto Watch buttons so Auto Watch
appears in a better position. The UI is still not great, but I think
this tweak will improve it until someone on design can help.

   Before: 

<img width="324" height="61"
alt="589131021-c967dfe1-9026-4a1d-a399-b735303f2de0"
src="https://github.com/user-attachments/assets/7cd414cd-5a13-4e16-ab6e-5de6d2cd64ed"
/>

   After:

<img width="373" height="77"
alt="589131282-607e15a5-e50c-4a8e-b22c-327f2e7b8ab5"
src="https://github.com/user-attachments/assets/7c19e0c8-8c50-4f8c-b966-f2a824eea4a0"
/>


- Disable Auto Watch when following another collaborator, with test
coverage for that behavior. We currently disable following when engaging
auto watch, and now we disable auto watch when following. They are
mutually exclusive and I think the feels correct.
- Refactored Auto Watch integration tests to use channels API instead of
room API.
- Improved test robustness by using assertions to identify
`SharedScreen` items by type and `peer_id` instead of tab title text.
- Fixed Auto Watch for returning channel participants by emitting
`RemoteVideoTracksChanged` when removing a participant with active video
tracks, with regression coverage for leave/rejoin/share.

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

Closes

Release Notes:

- N/A
2026-05-08 05:45:12 +00:00
Karol Broda
dccea211ed
auto_update: Add NixOS rsync install hint (#56097)
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
- [x] Performance impact has been considered and is acceptable

NixOS users who are missing rsync get a generic "Please install rsync
using your package manager" message.

Release Notes:

- Improved auto update error message for NixOS users missing rsync
2026-05-07 22:55:36 +00:00
Ben Brandt
ebc46d7e06
Update rmcp and rpassword (#56096)
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-05-07 21:48:12 +00:00
Agus Zubiaga
8bdcce86b6
settings_ui: Stop reading the clipboard on every frame (#56075)
`render_settings_item_link` was calling `cx.read_from_clipboard()`
during render so it could show a check icon next to the copy-link button
when the matching link was on the clipboard. This had two problems:

- A clipboard read per visible setting per frame is too expensive.
- On Windows, reading the clipboard pumps the system message queue. If a
queued message handler updates `App` while we're still rendering, GPUI
panics with `RefCell already borrowed` (many occurrences observed).

Track the `json_path` of the most recently copied setting locally
instead. The check icon now reflects what was copied in this session via
this UI rather than whatever is on the system clipboard.

While this removes the most common offender, the underlying
`gpui_windows` reentrancy bug still exists: `on_close` /
`on_request_frame` callbacks can be invoked while `App` is already
borrowed on Windows, and can be triggered by any other
clipboard-touching code path. We should consider a follow-up PR that
handles this at the platform layer -- either by deferring callbacks that
re-borrow `App`, or by guarding individual handlers in
`gpui_windows::events` against reentrant `borrow_mut` calls.

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:

- Fixed a crash on Windows that could occur when closing the settings
window
- Improved the overall performance of the settings window
2026-05-07 20:43:07 +00:00
Neel
1b88528b86
agent_ui: Handle Cut for selection mentions (#54694)
Following on from https://github.com/zed-industries/zed/pull/54031,
implement the same but for `Cut`.

Release Notes:

- N/A
2026-05-07 18:07:12 +00:00
Cole Miller
8624bf6689
git: Fix diff hunks not being removed on restore in remote projects (#54823)
Closes #48032 

When restoring a diff hunk, we first unstage it unconditionally. That
unstaging operation is a no-op in terms of the index text if the hunk
was already not staged, but previously we would still always do
`spawn_set_index_text_job` and bump the
`hunk_staging_operation_count_as_of_write`. Bumping that count in turn
causes us to skip a diff recalculation in response to the change in the
buffer's text. That works out fine in the local case, because when the
worktree picks up the write to `.git/index` we kick off another diff
recalculation which is not skipped. But in the remote case, we don't get
an `UpdateDiffBases` proto message if the index text didn't actually
change, so there is no subsequent diff calculation to do the cleanup,
and we end up with a stale no-op hunk.

This PR fixes the issue by skipping the write to the index and the
`hunk_staging_operation_count_as_of_write` bump if the new and old index
texts are the same.

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:

- Fixed a bug where restoring diff hunks in remote projects would leave
stale no-op hunks in the UI.
2026-05-07 17:40:28 +00:00
Cole Miller
10afe2ff28
git: Make git::Commit do an amend when amending is pending (#54472)
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:

- The `git::Commit` action (cmd-enter or ctrl-enter) will now commit a
pending amend.
2026-05-07 17:26:06 +00:00
Mikhail Pertsev
147524879e
editor: Extract fold and selection out of editor.rs (#56070)
cc @SomeoneToIgnore

## Summary

Follow-up to #56030 

This mechanically extracts two editor topics into focused sibling
modules:

- `crates/editor/src/fold.rs`
- `crates/editor/src/selection.rs`

One odd boundary remains: several selection state types still live in
`editor.rs`. I didn't move them because those caused that "huge 11k
diff" in the previous PR, so I propose to move them later.

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-05-07 16:14:47 +00:00
Cameron Mcloughlin
68256f2e1d
git: Add dev: show git job queue (#55904)
Adds a command to help debugging stuck git job queues

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-05-07 15:56:32 +00:00
Katie Geer
a6f41d1b83
Fix sign in disclaimer to accurately show trial benefits (#55964)
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-05-07 15:43:43 +00:00
Ben Brandt
5fc8a836dd
sidebar: Experimental Terminal Mode (#56063)
Experiment with allowing users to manage terminal sessions along with
threads in the sidebar.

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

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-05-07 15:39:16 +00:00
Sathwik Chirivelli
675ed70f59
Fix multibuffer initialization based on RHS state (#56058)
This update modifies the initialization of the left-hand side
multibuffer in the SplittableEditor. It now checks if the right-hand
side multibuffer is a singleton and uses a
`MultiBuffer::without_headers` instead.


Before Screenshot:
<img width="1624" height="1030" alt="Screenshot 2026-05-07 at 7 30
16 PM"
src="https://github.com/user-attachments/assets/3d963703-309c-42e4-b2be-fe64bd9c0a06"
/>

After Screenshot:
<img width="1624" height="1030" alt="Screenshot 2026-05-07 at 7 32
48 PM"
src="https://github.com/user-attachments/assets/51668319-6a34-47df-b8b1-8bf58b86407e"
/>


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)



Release Notes:
- Optimized multibuffer creation by conditionally using headers based on
RHS state.
2026-05-07 15:21:08 +00:00
Xiaobo Liu
bfe5dfb4a1
gpui_wgpu: Remove redundant match arms for backend priority (#56032)
Release Notes:

- N/A
2026-05-07 15:07:36 +00:00
María Craig
07c1943b43
Add telemetry events for agent profile usage and configuration (#56054)
Release Notes:

- N/A
2026-05-07 14:41:30 +00:00
Lukas Wirth
5c0b33f72e
gpui_windows: Avoid process-wide priority elevation (#56050)
We were incorrectly calling this with a thread handle, additionally
changing the process priority here doesn't make sense, so just drop
this.

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-05-07 14:09:39 +00:00
Bennet Bo Fenner
7556cf8ced
agent: Fix race-condition for LSP tool registration (#56044)
This fixes a race condition where the thread would not get the LSP tools
at startup if the feature flag was not resolved yet.
We now always add the tools, but filter them out when we start a new
turn if the feature flag is not set.

Release Notes:

- N/A
2026-05-07 13:47:13 +00:00
Mikhail Pertsev
bd2fb74037
editor: Extract completions and code_actions out of editor.rs (#56030)
cc @SomeoneToIgnore

## Summary

Follow-up to https://github.com/zed-industries/zed/discussions/55352,
where the conclusion was to split `editor.rs` incrementally by topic
instead of all at once.

This mechanically extracts two editor topics into focused sibling
modules:

- `crates/editor/src/code_actions.rs`
- `crates/editor/src/completions.rs`

One odd boundary remains: `Editor::context_menu()` is still a general
context-menu accessor, but it now lives in `code_actions.rs` because it
was part of the moved code actions block and is also used by
completions, Vim tests, agent UI, and the quick action bar. Would you
prefer that generic context-menu accessor stay in `editor.rs` for now
until context-menu code gets its own extraction?

## Testing

- `cargo check -p editor --lib`
- `cargo check -p editor --tests`
- `cargo check -p editor --lib --features test-support`

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-05-07 13:02:11 +00:00
Neel
4f54a04147
agent_ui: Restore Ctrl + > behavior for whole lines (#54698)
Restores current line fallback when using `Ctrl + >` to add context to
the agent.

Release Notes:

- N/A
2026-05-07 12:40:53 +00:00
Neel
9a125a553d
agent_ui: Preserve selection mentions when starting a new thread (#55203)
When the "+" button created a fresh draft, `active_initial_content`
fell back to the raw editor text when the async `draft_prompt`
observer had not yet resolved. That raw text contains fold placeholder
strings (e.g. "selection") rather than the mention links, so creases
and their registered URIs were dropped from the carried-over draft.

Related to https://github.com/zed-industries/zed/issues/53981.

Release Notes:

- Fixed a bug where selection mentions would resolve to the literal
`selection` rather than the URI in draft threads.
2026-05-07 12:40:48 +00:00
David Alecrim
e6b8b30e22
markdown: Improve table cell alignment (#53465)
## Summary

Markdown preview tables kept text pinned to the top of a row when a
neighboring cell contained a taller image. This made mixed
text-and-image tables look unbalanced and inconsistent with common
editor behavior. This change makes table text stay visually centered
within taller rows so Markdown tables are easier to scan and match
expected rendering more closely.

## Before / After

| Before | After |
| --- | --- |
| <img width="849" height="869" alt="Screenshot 2026-04-08 at 19 55 50"
src="https://github.com/user-attachments/assets/b3751bff-3750-4ca1-8997-6f5265e4d291"
/> | <img width="898" height="734" alt="Screenshot 2026-04-08 at 21 47
31"
src="https://github.com/user-attachments/assets/d853c0a1-800c-4a2a-aec9-e0ef08453fa7"
/> |

## References
Inspired by comparing this with VS Code preview
<img width="1286" height="878" alt="Screenshot 2026-04-08 at 21 54 06"
src="https://github.com/user-attachments/assets/8dbbfe28-9980-4012-94f1-1b5b3503065b"
/>

Release Notes:

- Improved Markdown preview table cells to vertically center content in
tall rows and respect column alignment from the table header.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-05-07 12:26:13 +00:00
Ben Kunkle
59daeba295
vim: Add setting to control whether edit predictions are shown in normal mode (#55956)
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:

- Added a setting
[vim.show_edit_predictions_in_normal_mode](zed://settings/vim.show_edit_predictions_in_normal_mode)
to control whether edit predictions are shown in normal mode.
2026-05-07 10:55:07 +00:00
Bennet Bo Fenner
47ea7de9c8
Fix leak detector causing panics in unit evals (#56029)
Fixed an issue where the leak detector would sometimes cause panics when
running unit evals. Fixed this by matching the tear-down logic that we
use in the `gpui::test` macro

> thread 'tools::evals::edit_file::eval_from_pixels_constructor'
(14336149) panicked at crates/gpui/src/app/entity_map.rs:1116:9:
Exited with leaked handles:
Leaked handle for entity language::buffer::Buffer (EntityId(50v1)):

Release Notes:

- N/A
2026-05-07 10:51:34 +00:00
Ben Brandt
7d19e89988
Fix DirectX atlas panic after GPU device recovery (#55878)
## Problem

A Sentry-reported crash on Windows (Intel Iris Xe Graphics, v1.0.1):

```
index out of bounds: the len is 1 but the index is 1
```

panicking at `DirectXAtlasState::texture` in

[`crates/gpui_windows/src/directx_atlas.rs`](https://github.com/zed-industries/zed/blob/main/crates/gpui_windows/src/directx_atlas.rs):

```rust
AtlasTextureKind::Subpixel => {
    &self.subpixel_textures[id.index as usize].as_ref().unwrap()
}
```

## Root cause

After a GPU device-lost recovery, GPUI's view cache replays stale
`AtlasTile`
references from the previous frame's `paint_operations` via
`Scene::replay`.

1. **Atlas grows past one texture.** A long enough session pushes
`subpixel_textures.textures.len() ≥ 2` (easy on Iris Xe at the default
1024×1024 atlas size). Top-level views in Zed use `cached(...)`, so
their
`AnyViewState.paint_range` records into
`rendered_frame.scene.paint_operations`,
   referencing both index `0` and index `1`.
2. **Device lost.** `handle_device_lost` clears every `AtlasTextureList`
(`textures.len() == 0`)
   and `tiles_by_key`, then sets `skip_draws = true`.
3. **`WM_GPUI_FORCE_UPDATE_WINDOW` arrives.** `mark_drawable()` flips
`skip_draws` back to `false` and `request_frame` runs with
`force_render: true`.
4. **The cache hit.** Inside `Window::draw`, `AnyView::prepaint`'s cache
check (`!dirty_views.contains(...) && !window.refreshing`) succeeds for
every cached view because the recovery doesn't touch invalidator state
and
`force_render` doesn't propagate into `Window`. `AnyView::paint` calls
`window.reuse_paint` → `Scene::replay` → `primitive.clone()`, which
(since
   `SubpixelSprite`/`AtlasTile` are `Copy`) verbatim copies a
`Primitive::SubpixelSprite { tile: { texture_id: { index: 1, ... }, ...
} }`
   into `next_frame.scene`.
5. **Atlas regrows to one.** Dirty/uncached parts of the same frame
   (caret, animations, anything that called `cx.notify`) fall through to
   `paint_glyph` → `get_or_insert_with` → `push_texture`, growing
`subpixel_textures.textures` from `0` to **`1`** with index `0` valid.
6. **Panic.** After `mem::swap`, `rendered_frame.scene` contains a mix
of
   fresh `index = 0` and replayed `index = 1` sprites. `Scene::batches`
emits separate batches per `texture_id`; the `index = 1` batch reaches
   `atlas.get_texture_view` → `subpixel_textures[1]` → panic with
   `len = 1, index = 1`.

The two earlier related fixes do not catch this:

- **#52389 / dbd95ea7** (`if force_render { mark_drawable }`) protects
the
200 ms recovery sleep — pending `WM_PAINT`s carry `force_render = false`
  and so do not clear `skip_draws`. But `WM_GPUI_FORCE_UPDATE_WINDOW`
  carries `force_render = true`, so `mark_drawable` runs, then
  `Window::draw`'s `reuse_paint` still reproduces stale tiles.
- The unmerged Windows draft `2e5d890e37`
(`force_render_after_recovery`)
  similarly only forces the forced-render branch — it doesn't bypass the
  view cache.

## Fix

Two parts:

**1. Bypass the view cache on a forced draw (cross-platform).**

In the platform-agnostic `request_frame` closure in `Window::new`, call
`window.refresh()` whenever `RequestFrameOptions::force_render` is
`true`.
`Window::refresh` is the documented escape hatch for cached views (per
the
`AnyView::cached` docs: *"The one exception is when [Window::refresh] is
called, in which case caching is ignored."*). With `refreshing = true`
every `AnyView::prepaint` cache check fails, every cached view fully
repaints, and `paint_glyph` allocates fresh tiles for every glyph, so
`rendered_frame.scene` ends up free of stale `AtlasTile`s.

**2. Add the `force_render_after_recovery` flag on Windows.**

Mirror the Linux fix from #52389: a per-window `Cell<bool>` set after
`WindowsWindowInner::handle_device_lost` succeeds and consumed at the
top
of `draw_window`. Together with the GPUI change above, the first frame
after recovery (whether a stray `WM_PAINT` during the 200 ms recovery
sleep or the explicit `WM_GPUI_FORCE_UPDATE_WINDOW`) is treated as a
forced render that both clears `skip_draws` and bypasses the view cache.

## Testing

- `script/clippy -p gpui` is clean.
- I do not have a Windows toolchain available locally, so I have not
  cross-compiled `gpui_windows`. Reviewers with Windows access — please
  smoke-test on a machine where the device-lost path can be exercised
  (Intel iGPU, suspend/resume, or running a TDR-inducing test on a GPU
  driver).

## Related

- Sentry issue ID 7457971403 (DirectX subpixel atlas crash, Intel Iris
Xe).
- Builds on / fixes the residual gap in #52389 (`gpui_linux: Force scene
  rebuild after GPU device recovery"). The GPUI change here also hardens
  the corresponding Linux path against the same `reuse_paint` mechanism.

Release Notes:

- Fixed a crash on Windows when the GPU device is lost and recovered
during use (typically driver crash, suspend/resume, or display
reconfiguration, most commonly on Intel iGPUs)
2026-05-07 10:22:52 +00:00
Bennet Bo Fenner
c6e9a95eba
x_ai: Update models list (#55931)
Updates the list of models being available based on
https://docs.x.ai/developers/models

From the xAI site:
<img width="750" height="169" alt="image"
src="https://github.com/user-attachments/assets/328c2743-2de7-4324-8eda-19e4b1f734e9"
/>

Closes #55883

Release Notes:

- agent: Added support for grok-4.3, grok-4.2 and removed deprecated xAI
models
2026-05-07 09:56:04 +00:00
Ben Brandt
b3a67c988f
markdown_preview: Implement reload (#56016)
If you implement can_save, you need to also support reload. Fix a bug
introduced in #53236

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 missing reload implementation for markdown preview.
2026-05-07 09:31:37 +00:00
Bennet Bo Fenner
42017bcad2
agent: Handle out of order old_text/new_text in edit file tool (#55894)
In the case where the model would respond with `new_text` before
`old_text`, we would just emit an empty `old_text`, because the parsing
layer was operating under the assumption that `old_text` occurs before
`new_text`.

We now hold back new text chunks if we receive them first, and only emit
them once old_text is complete.

In addition to that we also need to handle the case where the first
chunk contains `old_text` and `new_text`. In that case we don't know
which one of the two fields have finished streaming, since we can't rely
on the ordering anymore. Therefore we hold back all events until we
receive the full edit, and emit a single OldTextChunk (done = true) and
a single NewTextChunk (done = true)

Closes #55398

Release Notes:

- agent: Fixed an issue where editing would sometimes fail for specific
models (Deepseek v4)
2026-05-07 08:59:28 +00:00
YangChengxxyy
7fcc4ba343
eslint: Fix workspaceFolder.uri sent as raw path instead of `file:/… (#54383)
…/` URI

The ESLint adapter was sending `workspaceFolder.uri` as a raw filesystem
path (e.g. `/Users/foo/project`) instead of a proper `file://` URI (e.g.
`file:///Users/foo/project`).

This caused the vscode-eslint server's `workingDirectory: { mode: "auto"
}` to fail when resolving the workspace root, falling back to the linted
file's directory as the working directory. As a result,
`eslint-import-resolver-typescript` could not locate `tsconfig.json`,
breaking path alias resolution for rules like `import/order` — producing
different lint results compared to VS Code.

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 or Added/Fixed/Improved ...
2026-05-07 08:58:17 +00:00
Bruno Moreira
0a52f80824
acp_thread: Clear running_turn when prompt task drops tx (#55562)
`AcpThread::status` is purely `running_turn.is_some()`. The cleanup that
takes `running_turn` sat below the early-return guard that fires when
the prompt response oneshot resolves to `Err(Cancelled)` (the inner
`send_task` was dropped before `tx.send`). Any code path that drops the
in-flight `send_task` therefore left the panel stuck in `Generating`.
Reordered so cleanup runs before the dropped-tx guard; the same-turn
invariant is preserved.

Related to #47928 (partial — that issue also has an upstream
`claude-agent-acp` component this PR does not address).

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 agent panel staying in a generating state when the underlying
prompt task was cancelled before completing
2026-05-07 08:17:16 +00:00
Xin Zhao
6aa90e750d
docs: Update actions format (#54869)
Self-Review Checklist:

- [ ] 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

Change the actions in docs to adopt the right format.

Release Notes:

- N/A
2026-05-07 06:55:11 +00:00