Commit graph

4682 commits

Author SHA1 Message Date
Lukas Wirth
f21d51cf00
editor: Fix sticky headers not accounting for deleted diff hunks (#49296)
Release Notes:

- Fixed sticky headers sometimes disappearing when dealing with expanded
deleted diff hunks
2026-02-16 21:22:27 +00:00
Jakub Konka
9c889c163d
editor: Batch calls to fold_buffer in ProjectDiff::refresh (#49278)
This change improves performance of project diff in that:
* scrolling in split view for very large diffs (think chromium repo with
`git reset HEAD~1000`) is now very smooth on macOS and fairly smooth on
Linux
* switching from split to unified is very smooth on macOS, and fairly
smooth on Linux

There still remains the case of (severe) hangs when switching from
unified to split however, but it will be addressed in a follow-up PR.

Anyhow, here's the screenshot of the Instruments.app capture of opening
chromium repo in Zed in split view, scrolling a little, moving to
unified, scrolling some more, and moving back to split. Prior to this
change, split -> unified would cause a severe hang, whereas now it's a
hang and thus feels much smoother already (without Instruments profiling
is barely visible). Unified -> split severe hangs are still there but
don't last as long.

<img width="2301" height="374" alt="Screenshot 2026-02-16 at 5 46 23 PM"
src="https://github.com/user-attachments/assets/f687f8d4-cffd-47f1-ada1-f6c4d3ac3cd4"
/>

Release Notes:

- Improved project diff performance when opening very large
diffs/repositories.
2026-02-16 20:58:30 +01:00
Lukas Wirth
01b1d7dc55
editor: Sticky diff hunk controls (#49260)
Release Notes:

- Diff hunk controls now stick to the top of the editor viewport if the
top part of the hunk is outside the viewport
2026-02-16 13:17:05 +00:00
Coenen Benjamin
b6c48b60ab
search: Fix collapse/expand all button sync (#48773)
Derive collapsed state from `Editor.has_any_buffer_folded` instead of
tracking it separately, removing redundant `ResultsCollapsedChanged` event
and stale `is_collapsed`/`results_collapsed` fields.

Closes #48734 

Release Notes:

- Fixed collapse/expand all button in buffer search and project search
not syncing correctly when toggling individual file sections

---------

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-02-16 12:55:16 +00:00
ozacod
87ff3eb625
editor: Fix to remove non-functional folding creases from the gutter (#49200)
Lsp-based folding disables indentation-based folding. Even though
indentation-based folding is non-functional, the crease icon is still
displayed in the gutter. This PR fixes this mismatch.

Before:
<img width="651" height="199" alt="before"
src="https://github.com/user-attachments/assets/ebd202e8-9eda-43c9-adbd-767e9802e590"
/>

After:
<img width="666" height="197" alt="after"
src="https://github.com/user-attachments/assets/b498e325-cd06-4c51-afdb-fcda4f1a25e6"
/>


Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Removed non-functional folding creases from the gutter.

Co-authored-by: ozacod <ozacod@users.noreply.github.com>
2026-02-15 09:33:03 +00:00
Kirill Bulatov
ae12c80dca
Revert proejct search on type (#49163)
Reverts the whole "project search on type" set of PRs until we figure
out better ways to deal with flickering between search results
appearing.

Release Notes:

- N/A
2026-02-14 08:31:30 +00:00
Kirill Bulatov
a0eb63d1af
Fix search on input behavior (#49150)
Follow-up of https://github.com/zed-industries/zed/pull/42889

* disable by default
* add a configurable debounce, 200ms default

Release Notes:

- N/A
2026-02-13 23:20:13 +00:00
Oliver Azevedo Barnes
692a137782
agent: Add project-level disable_ai setting (#47902)
Closes #47854

Move `disable_ai` from root settings to `ProjectSettingsContent` to
enable per-project AI configuration via `.zed/settings.json`.

- Update settings UI to allow viewing/editing at both user and project
level
- Update editor to check project-level settings for edit predictions and
context menus
- Prevent MCP servers from starting when AI is disabled at project level

Note: SaturatingBool ensures that if user globally disables AI, projects
cannot re-enable it. Projects can only further restrict AI, not grant
it.

Release Notes:

- added support for disabling AI in project settings 

---------

Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
2026-02-13 11:57:43 -06:00
Shuhei Kadowaki
88e3954857
lsp: Sanitize newlines in document and workspace symbol names (#49092)
LSP servers may return symbol names containing newlines. Since outline
panel, breadcrumbs, and project search modal all expect single-line
items, collapse newlines before display.

- Document symbols: collapse newlines to spaces in name
- Workspace symbols: collapse newlines with `↵ ` separator for name and
container_name, preserving visual hint of original structure

Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 17:47:38 +00:00
holoflash
fee42e1d89
Add search_on_input setting to Project Search (#42889)
I was really missing the ability to instantly see search results while
typing in the Project Search and decided to try and implement it.
As this may not be a feature that _everyone_ wants, I made it
toggle-able via the settings (or the settings.json)
### Settings
Set to false by default
<img width="911" height="618" alt="Screenshot 2025-11-17 at 16 17 09"
src="https://github.com/user-attachments/assets/8eaaab65-684e-4c5f-9a3c-9cb62cff0925"
/>
### settings.json
Set to false by default
<img width="396" height="193" alt="Screenshot 2025-11-17 at 16 18 21"
src="https://github.com/user-attachments/assets/90ebda95-c454-4bc5-8423-5da593832fd2"
/>

### Video demo:

https://github.com/user-attachments/assets/715d6b77-3a61-45f8-8e1a-9bd880c697c3

- Search input is debounced with 250ms in this mode (cool?)


The desire for this feature has been expressed here too:
https://github.com/zed-industries/zed/discussions/30843

Release Notes:

- Enabled project search on input. Can be turned off with
`search.search_on_input` settings toggle.
2026-02-13 17:54:17 +02:00
Cole Miller
73853be484
git: Remove unnecessary block map recomputation when splitting SplittableEditor (#49075)
We had a call to `BlockMap::unfold_intersecting` that ended up
recomputing the entire block map for the RHS _without_ spacers, only to
throw it away in favor of the version with spacers a few lines down. Now
we only sync each block map once in `set_companion`.

Release Notes:

- Improved performance when toggling from the unified diff to the split
diff.

Co-authored-by: Jakub <jakub@zed.dev>
Co-authored-by: Cameron McLoughlin <cameron.studdstreet@gmail.com>
2026-02-13 15:52:04 +00:00
Cole Miller
b17ffdbec1
git: Fix misalignment in the split diff when inlays fall at the end of an excerpt (#49078)
- [x] Tests or screenshots needed?
- [ ] Code Reviewed
- [x] Manual QA

Release Notes:

- Fixed misalignment of lines in the split diff when using inlay hints.
2026-02-13 10:31:06 -05:00
Mayank Verma
0c29a0933f
editor: Fix soft wrap premature wrapping with certain fonts (#45206)
Closes #45107

Release Notes:

- Fixed soft wrap prematurely wrapping with certain fonts

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
2026-02-13 10:49:50 +00:00
Kirill Bulatov
69a2ea3fff
Fix document highlight data issues (#49079)
Follow-up of https://github.com/zed-industries/zed/pull/48780

Fixes incorrect multi byte characters treatment in the symbol range when
highlighting:
<img width="1728" height="507" alt="image"
src="https://github.com/user-attachments/assets/c6639220-f08a-4ea8-bf99-926566e356ae"
/>

Fixes multiple language servers' duplicate data display:
<img width="1726" height="925" alt="image"
src="https://github.com/user-attachments/assets/ca98ee29-732e-4c8e-adf4-21a9523a5a9c"
/>


Release Notes:

- N/A
2026-02-13 00:55:26 +00:00
Oleksiy Syvokon
aa4e1b47dc
Separate accepted edit predictions in edit history (#49056)
Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2026-02-13 00:15:59 +00:00
Kirill Bulatov
44015e0379
Fix semantic highlights not cleared when disabled in settings (#49066)
Closes https://github.com/zed-industries/zed/issues/49060

Release Notes:

- Fixed semantic highlights not cleared when disabled in settings
2026-02-12 20:52:46 +00:00
Lukas Wirth
213de2ec9b
editor: Do not include inlays in word diff highlights (#49007)
Release Notes:

- Fixed inlay hints being rendered as new inserted words in word based
diff highlighting

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-12 09:26:06 +00:00
Kirill Bulatov
c6cd08e37a
Use document symbols' ranges to derive their outline labels (#48978) 2026-02-12 09:36:48 +02:00
Richard Feldman
ee3f40fe25
Re-add MultiWorkspace (#48800)
Release Notes:

- Added agent panel restoration. Now restarting your editor won't cause
your thread to be forgotten.

---------

Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Eric Holk <eric@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>
2026-02-12 01:06:23 +00:00
Mikayla Maki
83de8a25e0
Revert PRs for landing in main (#48969)
We're going to re-apply these after landing the multiworkspace branch.

Release Notes:

- N/A
2026-02-12 00:28:17 +00:00
Cole Miller
b53ff3b893
git: Disable some more expensive things for the split diff's left-hand side (#48953)
- Conflict UI
- LSP data
- Runnables

Release Notes:

- Improved performance when opening the split diff view.
2026-02-11 21:58:55 +00:00
Kirill Bulatov
56504fdd0f
Support LSP document symbols in breadcrumbs and outline UI (#48780) 2026-02-11 21:30:03 +02:00
Katie Geer
f233ae4c29
Add telemetry for user-facing notifications (#48558)
## Summary

Adds a "Notification Shown" telemetry event that fires whenever a
user-facing notification is displayed in Zed. This helps the team
understand error patterns, notification frequency, and which parts of
the application generate the most notifications.

## Event Schema

| Property | Type | Description |
|----------|------|-------------|
| `notification_type` | `string` | `"error"` or `"notification"` |
| `source` | `string` | Origin category (e.g., `lsp`, `git`, `settings`,
`editor`) |
| `lsp_name` | `string?` | Language server name (only for LSP
notifications) |
| `level` | `string?` | Severity: `"critical"`, `"warning"`, or `"info"`
|
| `has_actions` | `bool` | Whether the notification has action buttons |
| `notification_id` | `string` | Debug string of the NotificationId |
| `is_auto_dismissing` | `bool` | Whether the notification
auto-dismisses |

## NotificationSource Categories

A new `NotificationSource` enum categorizes notifications by origin:

- `lsp` - Language server notifications
- `settings` - Settings/keymap parse errors
- `update` - App updates, release notes
- `extension` - Extension suggestions/errors
- `git` - Git operations, commit errors
- `project` - Project-level issues
- `collab` - Collaboration notifications
- `remote` - SSH/remote project errors
- `file` - File access errors
- `editor` - Editor operations (search, encoding)
- `agent` - AI assistant notifications
- `cli` - CLI installation
- `system` - Generic fallback

## Privacy

**Message content is intentionally not included** in telemetry because:
- LSP messages come from external servers and may contain file paths or
error chains
- Error messages may contain sensitive paths or API-related information
- The metadata alone provides sufficient insight for error tracking

## Implementation

Updated function signatures to include `NotificationSource`:
- `show_notification(id, source, cx, build_fn)`
- `show_toast(toast, source, cx)`
- `show_error(err, source, cx)`
- `show_app_notification(id, source, cx, build_fn)`
- `notify_err(workspace, source, cx)`
- `notify_async_err(source, cx)`
- `notify_app_err(source, cx)`
- `detach_and_notify_err(source, window, cx)`

Release Notes

- N/A (internal telemetry change)

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-11 10:21:37 -08:00
Cole Miller
40b468e69e
git: Fix another WrapPointCursor panic in spacer_blocks (#48932)
Closes ZED-4ZH

Release Notes:

- N/A
2026-02-11 12:55:51 +00:00
Cole Miller
f7314976bd
git: Enable the split diff for everyone (#48912)
Release Notes:

- Added support for viewing diffs in split ("side by side") mode
2026-02-11 06:28:55 +00:00
Cole Miller
05e99dad54
git: Standardize nomenclature for side-by-side diff (#48910)
"Unified" for the old view, and "split" for the new one.

Release Notes:

- N/A
2026-02-11 05:33:03 +00:00
Cole Miller
74419f6a0d
git: Correct logic for updating companion excerpt IDs mapping (#48906)
We try to remove old excerpt IDs from the companion when mutating
excerpts for a path, but we were incorrectly doing this using the
excerpt IDs for the right-hand side multibuffer _after_ any excerpt
mutations had occurred, causing stale excerpt IDs to accumulate.

Release Notes:

- N/A
2026-02-11 04:02:02 +00:00
Cole Miller
c8054cacbd
git: Fix searching in the split diff (#48894)
- Fix panics caused by reusing cached matches for the wrong side
- Highlight matches on the side that was searched only
- Clear matches in non-searched editor when initiating a new search

Release Notes:

- N/A

---------

Co-authored-by: Eric <eric@zed.dev>
Co-authored-by: Jakub <jakub@zed.dev>
2026-02-10 23:29:51 +00:00
Marco Mihai Condrache
de7f2f0186
Improve performance when detecting JSX auto close (#48622)
Helps #48601

<img width="1649" height="1071" alt="image"
src="https://github.com/user-attachments/assets/ff3dfee0-cc65-430f-a5fa-b4b4c36e8183"
/>


`syntax_layers` does some offset conversion that might require getting
some chunks from the rope, which is quite expensive. For detecting
autoclose, we only use the language from those syntax layers, so having
a short path that skips all the conversion should skip some sum_tree
traversals.
   
I'm pretty sure other places would benefit from this as well, but I
haven't searched them yet.

Release Notes:

- N/A

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-02-10 20:46:28 +05:30
Cole Miller
4177be4479
git: Optimize patch_for_range functions (#48852)
These are heavily used by the side-by-side diff. Previously, we were
iterating over all hunks for each call. Now we skip hunks that can't
affect the provided range.

Release Notes:

- N/A
2026-02-10 01:19:01 -05:00
Cole Miller
d7129634ee
git: Fix missing excerpts panic with side-by-side diff (#48755)
When we update excerpts, pull the changes to the `Companion` excerpt
mappings into the multibuffer's update block, so that buffer
subscriptions don't get the chance to run and observe an invalid state
while attempting to snapshot the editor

Release Notes:

- N/A

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2026-02-09 17:16:11 -05:00
Cameron Mcloughlin
7a18c4126a
git: Side-by-side diff UX improvements (#48821)
- No more "locked mode", it's on by default
- Only `ToggleDiffView` action
- Re-enable code actions on the RHS

Release Notes:

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

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2026-02-09 21:55:47 +00:00
Cole Miller
7390b449f9
git: Fix panic when folding ranges (#48809)
Restore a call to `BlockMap::read` that went missing in #48747 

Release Notes:

- N/A
2026-02-09 13:39:48 -05:00
Cole Miller
8582ca68a5
git: Fix a panic in spacer_blocks (#48753)
Closes ZED-4X5

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-09 10:34:55 -05:00
Finn Evers
165b404460
Revert "New multi workspace (#47795)" (#48776)
Preparing this just in case.

Release Notes:

- N/A
2026-02-09 15:37:16 +01:00
Finn Evers
bdff8bf47c
Ensure proper workspace is used for various actions (#48767)
The multi workspace refactor **completely** broke the Vim mode, saving
is not possible, and various other actions. This PR fixes this

- [X] Code Reviewed
- [X] Manual QA

Release Notes:

- N/A
2026-02-09 10:33:36 +00:00
Mikayla Maki
1c21718587
New multi workspace (#47795)
It's happeningggggg

Release Notes:

- Changed the Agent Panel so that the Active Thread is restored on
restart.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Richard Feldman <richard@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-08 17:46:51 -08:00
Cole Miller
930f484fe4
git: Follow-up fixes for custom blocks in the side-by-side diff (#48747)
- Ensure that both sides are passed the appropriate companion data to
preserve spacers when syncing
- Remove companion handling in codepaths related to range folding, since
this isn't supported in the side-by-side diff
- Move handling of buffer folding into the block map
- Rework `set_companion` to handle both `DisplayMap`s at once
- DRY some code around block map syncing in the `DisplayMap`

TODO:

- [x] diagnose and fix issue that causes balancing blocks not to render
properly when they are adjacent to spacers (e.g. merge conflict buttons)
- [x] clear balancing blocks when clearing companion
- [x] additional tests: interaction between spacers and balancing
blocks, resizing

Release Notes:

- N/A
2026-02-08 20:10:52 -05:00
Kirill Bulatov
809d54524e
Properly handle multi-char folds (#48721)
Follow-up of https://github.com/zed-industries/zed/pull/48611

Release Notes:

- N/A
2026-02-08 08:56:22 +00:00
Cole Miller
35160555da
git: Fix a potential misalignment in the side-by-side diff (#48690)
Release Notes:

- N/A
2026-02-07 18:07:23 +00:00
Cole Miller
869919160b
git: Add a setting for the default view mode of SplittableEditor (#48440)
Release Notes:

- N/A
2026-02-07 17:26:02 +00:00
xdBronch
10c3c088fe
editor: Propagate buffer_font_features to signatureHelp popover (#48653)
Closes #48596

Release Notes:

- N/A
2026-02-07 02:36:46 +02:00
Bertie690
db53a65ab6
Add configurable LSP timeout setting (#44745)
Fixes #36818

Release Notes:

- Added new `global_lsp_settings.request_timeout` setting to configure
the maximum timeout duration for LSP-related operations.

Code inspired by [prior
implementation](https://github.com/zed-industries/zed/pull/38443),
though with a few tweaks here & there (like using `serde:default` and
keeping the pre-defined constant in the LSP file).

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-02-07 00:36:37 +00:00
xdBronch
52cddaae37
editor: Use buffer_font for folds and change foreground color (#48652)
re: https://github.com/zed-industries/zed/pull/48624
using the UI font could cause a visual bug when the cursor was over the
folded text
before:
<img width="191" height="48" alt="image"
src="https://github.com/user-attachments/assets/def0be7d-6fb3-4890-be47-cafee67558a3"
/>
after:
<img width="194" height="47" alt="image"
src="https://github.com/user-attachments/assets/a9b6fb8b-5646-4bd5-9108-b6f792f4571e"
/>

changing the color is of course just opinionated but i think it looks
better and makes more sense as a placeholder

Release Notes:

- N/A
2026-02-07 00:20:03 +00:00
Kirill Bulatov
52099b45e7
Fix panic with LSP folds on disappearing excerpts (#48649)
Follow-up of https://github.com/zed-industries/zed/pull/48611

Release Notes:

- N/A
2026-02-06 23:22:28 +00:00
Kirill Bulatov
30ec2ca370
Support custom fold text for LSP folds (#48624)
Follow-up of https://github.com/zed-industries/zed/pull/48611

Release Notes:

- N/A
2026-02-06 22:24:38 +02:00
Piotr Osiewicz
a8ae51cb97
build: Tear up crate graph (move terminal closer to editor) (#48602)
- **build: remove assistant_slash_commands dependency in
assistant_text_thread**
- **diagnostics: Do not depend on search**
- **Remove terminal_view's dependency on search**
- **sever breadcrumbs <-> editor dep (for the sake of terminal_view)**

Release Notes:

- N/A
2026-02-06 20:14:35 +01:00
Kirill Bulatov
6c253a7d68
Add textDocument/foldingRange LSP support (#48611)
Closes https://github.com/zed-industries/zed/issues/28091

Off in language settings by default: ` "lsp_folding_ranges": "off",`,
when enabled, disables tree-sitter indent-based folding and enables
fetching of LSP ones instead.
Falls back to tree-sitter if LSP-based one brings no results.

Release Notes:

- Added `textDocument/foldingRange` LSP support, use `
"lsp_folding_ranges": "on",` language settings to fetch and prefer the
LSP folds
2026-02-06 18:06:01 +00:00
Kirill Bulatov
980479fb7c
Refactor LSP-related logic (#48604)
* split more logic away into its own modules for document colors, code
lens and inlay hints
* remove unnecessary cache_version for document colors

Release Notes:

- N/A
2026-02-06 16:58:18 +00:00
Cole Miller
8e56667625
git: Implement OpenExcerpts for the left side of the side-by-side diff (#48438)
By opening the corresponding positions in the corresponding main
buffers.

Release Notes:

- N/A
2026-02-06 15:46:23 +00:00