Commit graph

411 commits

Author SHA1 Message Date
Danilo Leal
700b0b5de6
agent_ui: Render skills as creases (#56689)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
Closes AI-230

This PR makes skills, added as /-mentions, be rendered in the agent
panel as creases, like anything you'd @-mention. Naturally, clicking on
the crease button opens the corresponding skill file in a buffer.

It turned out to be quite a bit of plumbing to make this work,
particularly as I am also introducing an interface to display dividers
and headers in the completion menu. This was relevant to me to add
because it sets a good foundation to convert many agent panel-related
actions as slash commands.

Release Notes:

- N/A

---------

Co-authored-by: MartinYe1234 <52641447+MartinYe1234@users.noreply.github.com>
2026-05-14 22:20:34 +00:00
Alejandro Fernández Gómez
917c698483
Use available width for the labels in the debug modal (#56510)
AI disclosure: the PR has been made with claude code assistance

Before:
<img width="681" height="307" alt="Screenshot 2026-05-12 at 10 06 02"
src="https://github.com/user-attachments/assets/8ea24d32-345c-402f-ba4c-b29c80d97d3c"
/>

After:
<img width="678" height="312" alt="Screenshot 2026-05-12 at 10 05 46"
src="https://github.com/user-attachments/assets/1b3c42dc-a66b-46d0-a156-ff76769b7bb8"
/>

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 #56505

Release Notes:

- Fixed eagerly truncated labels in the Debug modal.
2026-05-12 16:41:26 +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
Conrad Irwin
be705e677b
Merge gpui::Task and scheduler::Task (#53674)
Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-05 22:41:13 +00:00
Lukas Wirth
8aedcbf410
debugger_ui: Fix debugger tab drop crash (#55667)
Avoid reading the source debugger pane during SubView drop handling
because it may be the Pane currently being updated. Use the DraggedTab
item handle to validate the drop and capture the item id, leaving
source-pane reads to the deferred move. Add a regression test for a
stale SubView host pane during tab drop.

Fixes ZED-74F

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-04 16:31:27 +00:00
Yara 🏳️‍⚧️
320888142f
Rust 1.95 (#55104)
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
2026-04-29 10:27:47 +00:00
Om Chillure
d06406f7d8
Fix debugger start ignoring save property (#53353)
## Summary

When `debugger::Start` runs a build task (via the `"build"` field in
`debug.json`), it was bypassing the task's `"save"` property and calling
`project.create_terminal_task()` directly. This meant unsaved files were
never saved before the build ran, even when `"save": "all"` was set
unlike `task: spawn` which correctly saved first.

**Changes:**
- Extracted `Workspace::save_for_task(workspace, strategy, cx)` as a
shared async helper in `workspace/src/tasks.rs`
- Refactored `schedule_resolved_task` to call this helper (no behavior
change, removes inline duplication)
- Called the same helper in `RunningState::resolve_scenario` before
`create_terminal_task`, so the debugger build path now respects the
task's `save` strategy
- Added `test_save_for_task_all`, `test_save_for_task_current`, and
`test_save_for_task_none` tests covering the extracted helper directly

## 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 #53284

## Video after fix

[Screencast from 2026-04-08
08-04-18.webm](https://github.com/user-attachments/assets/b0c20164-3670-440a-b43a-8457fb57bfbd)



## Release Notes:

- Fixed debugger not saving files before running a build task when
`"save": "all"` is set in the task definition
2026-04-21 19:25:21 +00:00
Jason Lee
84dcf38dbe
gpui: Improve Anchored to support center position (#47154)
Release Notes:

- N/A

Ref https://github.com/longbridge/gpui-component/pull/1956 extract my
fork version of `anchored.rs` to let GPUI to support position Anchored
at center.


https://github.com/user-attachments/assets/8d0230ed-4b75-440b-b8c3-9bde3decd141

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 09:01:42 +00:00
Mikayla Maki
ec9be5c332
Feature flag overrides (#54206)
This PR revamps our feature flag system, to enable richer iteration. 

Feature flags can now:
- Support enum values, for richer configuration
- Be manually set via the settings file
- Be manually set via the settings UI

This PR also adds a feature flag to demonstrate this behavior, a
`agent-thread-worktree-label`, which controls which how the worktree tag
UI displays.

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-04-18 06:34:19 +00:00
Yara 🏳️‍⚧️
73126dcb81
editor: Introduce Bookmarks (#54174)
Adds basic bookmark functionality to the editor, allowing users to mark
lines and later navigate between them. This is an MVP and will later be
expanded with a picker, vim marks integration and syntax tree based
bookmark positions. In this MVP bookmarks shift under external edits.

# UI
## Adding/Removing bookmarks
To add a bookmark:
- run the toggle bookmark action 
- hold secondary and click in the gutter
- open the context menu by right clicking in the gutter and select add
bookmark To remove a bookmark:
- run the toggle bookmark action 
- click on the bookmarks icon in the gutter
- open the context menu by right clicking in the gutter and select
remove bookmark

remove all bookmarks with `workspace: clear bookmarks`


# Implementation
This mirrors the implementation of breakpoints. The rendering of the
gutter was refactored to make place for bookmark icons and buttons:
- Code was extracted to a `Gutter` struct
- Runnables, breakpoints and bookmarks are now collected ahead of
layouting. Just before layouting we remove the items that collide and do
not have priority.
- The `phantom_breakpoint` is replaced by a `gutter_hover_button`

## In depth phantom breakpoint discussion:
This was phantom_breakpoint. It worked as follows:
 - A fake breakpoint was added to the list of breakpoints.
- While rendering the breakpoints it a breakpoint turned out to be fake
it would get a different description and look.
- The breakpoint list was edited run_indicators ("play buttons")
rendering to removes the fake breakpoint if it collided.

This would not scale to more functionality. Now we only render
breakpoints, bookmarks and run indicators. Then we render a button if
there is not breakpoint, bookmark or run indicator already present. We
can do so since the rendering of such "gutter indicators" has been
refactored into two phases:
 - collect the items.
 - render them if no higher priority item collides.

This is far easier and more readable which enabled me to easily take the
phantom_breakpoint system and use it for placing bookmarks as well :)

Note: this was previously merged but it needed a better squashed commit
message. For the actual PR see: 51404. This reverts commit
7e523a2d2b.

Release Notes:

- Added Bookmarks

Co-authored-by: Austin Cummings <me@austincummings.com>
2026-04-17 13:54:43 +02:00
Yara 🏳️‍⚧️
7e523a2d2b
Revert "editor: Bookmarks MVP" to update its description (#54163)
Reverts zed-industries/zed#51404 because I forgot to updated the
squashed commits description ....
2026-04-17 10:55:05 +00:00
Austin Cummings
79473da756
editor: Bookmarks MVP (#51404)
Closes #4526

Adds basic bookmark functionality to the editor, allowing users to mark
lines and later navigate between them.

### What's new

**Toggling bookmarks**
Users can toggle a bookmark on the current line(s) via the `editor:
toggle bookmark` action. A bookmark icon appears in the gutter for each
bookmarked line.

**Navigation**
Two new actions, `editor: go to next bookmark` and `editor: go to
previous bookmark`, navigate between bookmarks in the current buffer,
wrapping around at the ends of the buffer.

**Viewing all bookmarks**
`editor: view bookmarks` opens all bookmarks across the project in a
multibuffer, similar to how references and diagnostics are surfaced.

**Clearing bookmarks**
`workspace: clear bookmarks` removes all bookmarks in the current
project.

**Persistence**
Bookmarks are persisted to the workspace database and restored when the
workspace is reopened. They are stored as `(path, row)` pairs and
resolved back to text anchors. Out of range or unresolvable bookmarks
are skipped with a logged warning.

**Gutter rendering**
Bookmark icons are rendered in the gutter using the existing gutter
button layout system, consistent with breakpoints. They are suppressed
on lines that already show a breakpoint or phantom breakpoint indicator.
A new `gutter.bookmarks` setting (defaulting to `true`) controls their
visibility.

### What's left

- [x] Lazily load buffers that have bookmarks
- [x] Clean up test boilerplate
- [ ] Assign default keybindings
- [ ] Compare line of saved bookmarks with current buffer (gray out the
"stale" bookmarks)

### What's next (and nice to haves)
- [ ] Resilience against external edits
- [ ] Save column position with the bookmark
- [ ] Bookmarks attached to syntactic structures?
- [ ] Labeled bookmarks?

---

Release Notes:

- Added bookmarks: toggle bookmarks on lines with `editor: toggle
bookmark`, navigate with `editor: go to next bookmark` / `editor: go to
previous bookmark`, view all bookmarks with `editor: view bookmarks`,
and clear with `workspace: clear bookmarks`. Bookmarks are shown in the
gutter and persisted across sessions.

---------

Co-authored-by: Yara <git@yara.blue>
2026-04-17 12:39:07 +02:00
Danilo Leal
74de476364
Simplify parallel agents onboarding (#53854)
- Adds a status toast to the announcement banner for surfacing the
layout revert option
- Removes the agent panel banner

A good chunk of the diff here was because I touched up the status toast
component API a little bit.

Release Notes:

- N/A
2026-04-15 21:51:15 -03:00
Cameron Mcloughlin
da6ac6c551
workspace: Add separate "format and save" action (#53710)
Release Notes:

- Added `workspace: format and save` action which always formats,
regardless of settings
2026-04-14 16:20:05 +01:00
Kirill Bulatov
2635ef55c6
Restrict mouse wheel zoom for certain editors (#53598)
Follow-up of https://github.com/zed-industries/zed/pull/53452

* disables mouse wheel zooming in agent, debugger, keymap editor, dev
inspector and repl-related editors
* adjusts the code to call for theme changes directly instead of sending
the events, so that agent following does not capture the events and
changes its font size

Release Notes:

- N/A
2026-04-10 09:20:38 +00:00
Cole Miller
2a15bf630d
Require multibuffer excerpts to be ordered and nonoverlapping (#52364)
TODO:
- [x] merge main
- [x] nonshrinking `set_excerpts_for_path`
- [x] Test-drive potential problem areas in the app
- [x] prepare cloud side
- [x] test collaboration
- [ ] docstrings
- [ ] ???

## Context

### Background

Currently, a multibuffer consists of an arbitrary list of
anchor-delimited excerpts from individual buffers. Excerpt ranges for a
fixed buffer are permitted to overlap, and can appear in any order in
the multibuffer, possibly separated by excerpts from other buffers.
However, in practice all code that constructs multibuffers does so using
the APIs defined in the `path_key` submodule of the `multi_buffer` crate
(`set_excerpts_for_path` etc.) If you only use these APIs, the resulting
multibuffer will maintain the following invariants:

- All excerpts for the same buffer appear contiguously in the
multibuffer
- Excerpts for the same buffer cannot overlap
- Excerpts for the same buffer appear in order
- The placement of the excerpts for a specific buffer in the multibuffer
are determined by the `PathKey` passed to `set_excerpts_for_path`. There
is exactly one `PathKey` per buffer in the multibuffer

### Purpose of this PR

This PR changes the multibuffer so that the invariants maintained by the
`path_key` APIs *always* hold. It's no longer possible to construct a
multibuffer with overlapping excerpts, etc. The APIs that permitted
this, like `insert_excerpts_with_ids_after`, have been removed in favor
of the `path_key` suite.

The main upshot of this is that given a `text::Anchor` and a
multibuffer, it's possible to efficiently figure out the unique excerpt
that includes that anchor, if any:

```
impl MultiBufferSnapshot {
    fn buffer_anchor_to_anchor(&self, anchor: text::Anchor) -> Option<multi_buffer::Anchor>;
}
```

And in the other direction, given a `multi_buffer::Anchor`, we can look
at its `text::Anchor` to locate the excerpt that contains it. That means
we don't need an `ExcerptId` to create or resolve
`multi_buffer::Anchor`, and in fact we can delete `ExcerptId` entirely,
so that excerpts no longer have any identity outside their
`Range<text::Anchor>`.

There are a large number of changes to `editor` and other downstream
crates as a result of removing `ExcerptId` and multibuffer APIs that
assumed it.

### Other changes

There are some other improvements that are not immediate consequences of
that big change, but helped make it smoother. Notably:

- The `buffer_id` field of `text::Anchor` is no longer optional.
`text::Anchor::{MIN, MAX}` have been removed in favor of
`min_for_buffer`, etc.
- `multi_buffer::Anchor` is now a three-variant enum (inlined slightly):

```
enum Anchor {
    Min,
    Excerpt {
        text_anchor: text::Anchor,
        path_key_index: PathKeyIndex,
        diff_base_anchor: Option<text::Anchor>,
    },
    Max,
}
```

That means it's no longer possible to unconditionally access the
`text_anchor` field, which is good because most of the places that were
doing that were buggy for min/max! Instead, we have a new API that
correctly resolves min/max to the start of the first excerpt or the end
of the last excerpt:


```
impl MultiBufferSnapshot {
    fn anchor_to_buffer_anchor(&self, anchor: multi_buffer::Anchor) -> Option<text::Anchor>;
}
```
- `MultiBufferExcerpt` has been removed in favor of a new
`map_excerpt_ranges` API directly on `MultiBufferSnapshot`.

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Conrad <conrad@zed.dev>
2026-04-01 17:25:32 +00:00
Piotr Osiewicz
b59ae5cf81
Bump Rust version to 1.94 (#51086)
Closes #ISSUE

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

Release Notes:

- N/A
2026-03-30 09:06:59 +00:00
Piotr Osiewicz
93e641166d
theme: Split out theme_settings crate (#52569)
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

Closes #ISSUE

Release Notes:

- N/A
2026-03-27 14:41:25 +01:00
Mikayla Maki
8eb86241f6
Add a setting for moving the sidebar to the right (#52457)
## Context

This adds a setting for controlling the sidebar side

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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: Eric <eric@zed.dev>
2026-03-26 01:35:10 +00:00
Nathan Sobo
3ce0cd11ec
Extract language_core and grammars crates from language (#52238)
This extracts a `language_core` crate from the existing `language`
crate, and creates a `grammars` data crate. The goal is to separate
tree-sitter grammar infrastructure, language configuration, and LSP
adapter types from the heavier buffer/editor integration layer in
`language`.

## Motivation

The `language` crate pulls in `text`, `theme`, `settings`, `rpc`,
`task`, `fs`, `clock`, `sum_tree`, and `fuzzy` — all of which are needed
for buffer integration (`Buffer`, `SyntaxMap`, `Outline`,
`DiagnosticSet`) but not for grammar parsing or language configuration.
Extracting the core types lets downstream consumers depend on
`language_core` without pulling in the full integration stack.

## Dependency graph after extraction

```
language_core   ← gpui, lsp, tree-sitter, util, collections
grammars        ← language_core, rust_embed, tree-sitter-{rust,python,...}
language        ← language_core, text, theme, settings, rpc, task, fs, ...
languages       ← language, grammars
```

## What moved to `language_core`

- `Grammar`, `GrammarId`, and all query config/builder types
- `LanguageConfig`, `LanguageMatcher`, bracket/comment/indent config
types
- `HighlightMap`, `HighlightId` (theme-dependent free functions
`highlight_style` and `highlight_name` stay in `language`)
- `LanguageName`, `LanguageId`
- `LanguageQueries`, `QUERY_FILENAME_PREFIXES`
- `CodeLabel`, `CodeLabelBuilder`, `Symbol`
- `Diagnostic`, `DiagnosticSourceKind`
- `Toolchain`, `ToolchainScope`, `ToolchainList`, `ToolchainMetadata`
- `ManifestName`
- `SoftWrap`
- LSP data types: `BinaryStatus`, `ServerHealth`,
`LanguageServerStatusUpdate`, `PromptResponseContext`, `ToLspPosition`

## What stays in `language`

- `Buffer`, `BufferSnapshot`, `SyntaxMap`, `Outline`, `DiagnosticSet`,
`LanguageScope`
- `LspAdapter`, `CachedLspAdapter`, `LspAdapterDelegate` (reference
`Arc<Language>` and `WorktreeId`)
- `ToolchainLister`, `LanguageToolchainStore` (reference `task` and
`settings` types)
- `ManifestQuery`, `ManifestProvider`, `ManifestDelegate` (reference
`WorktreeId`)
- Parser/query cursor pools, `PLAIN_TEXT`, point conversion functions

## What the `grammars` crate provides

- Embedded `.scm` query files and `config.toml` files for all built-in
languages (via `rust_embed`)
- `load_queries(name)`, `load_config(name)`,
`load_config_for_feature(name, grammars_loaded)`, and `get_file(path)`
functions
- `native_grammars()` for tree-sitter grammar registration (behind
`load-grammars` feature)

## Pre-cleanup (also in this PR)

- Removed unused `Option<&Buffer>` from
`LspAdapter::process_diagnostics`
- Removed unused `&App` from `LspAdapter::retain_old_diagnostic`
- Removed `fs: &dyn Fs` from `ToolchainLister` trait methods
(`PythonToolchainProvider` captures `fs` at construction time instead)
- Moved `Diagnostic`/`DiagnosticSourceKind` out of `buffer.rs` into
their own module

## Backward compatibility

The `language` crate re-exports everything from `language_core`, so
existing `use language::Grammar` (etc.) continues to work unchanged. The
only downstream change required is importing `CodeLabelExt` where
`.fallback_for_completion()` is called on the now-foreign `CodeLabel`
type.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Tom Houlé <tom@tomhoule.com>
2026-03-25 23:41:09 +00:00
Finn Evers
e63bd1ab32
language: Improve highlight map resolution (#52183)
This PR refactors the highlight map capture name resolution to be faster
and more predictable. Speficically,
- it changes the capture name matching to explicit prefix matching
(e.g., `function.call.whatever.jsx` will now be matched by only
`function`, `function.call`, `function.call.whatever` and
`function.call.whatever.jsx`). This matches the behavior VSCode has
- resolving highlights is now much more efficient, as we now look up
captures in a BTreeMap as opposed to searching in a Vector for these.

This substantially improves the performance for resolving capture names
against themes. With the benchmark added here for creating the
HighlightMap, we see quite some improvements:
```
Running benches/highlight_map.rs (target/release/deps/highlight_map-f99da68650aac85b)
HighlightMap::new/small_captures/small_theme
                        time:   [161.90 ns 162.70 ns 163.55 ns]
                        change: [-39.027% -38.352% -37.742%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  3 (3.00%) high mild
HighlightMap::new/small_captures/large_theme
                        time:   [231.37 ns 233.02 ns 234.70 ns]
                        change: [-91.570% -91.516% -91.464%] (p = 0.00 < 0.05)
                        Performance has improved.
HighlightMap::new/large_captures/small_theme
                        time:   [991.82 ns 994.94 ns 998.50 ns]
                        change: [-50.670% -50.443% -50.220%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  5 (5.00%) high mild
HighlightMap::new/large_captures/large_theme
                        time:   [1.6528 µs 1.6650 µs 1.6784 µs]
                        change: [-91.684% -91.637% -91.593%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) low mild
```

For large themes and many capture names, the revised approach is much
faster.

With that in place, we can also add better fallbacks whenever we change
tokens, since e.g. a change from `@variable` to `@preproc` would
previously cause tokens to not be highlighted at all, whereas now we can
add fallbacks for such cases more efficiently. I'll add this later on to
this PR.


## Self-Review Checklist

<!-- Check before requesting review: -->
- [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 cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

Release Notes:

- Improved resolution speed of theme highlight capture names. This might
change highlighting in some rare edge cases, but should overall make
highlighting more predicatable. Theme captures will now follow a strict
prefix matching, so e.g. function.call.decorator.jsx` will now be
matched by only `function`, `function.call`, `function.call.decorator`
and `function.call.decorator.jsx` with the most specific capture always
taking precedence.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Gaauwe Rombouts <mail@grombouts.nl>
2026-03-25 17:01:17 +01:00
Marc-Andre Lureau
58fec75396
Add vim/emacs modeline support (#49267)
Many editors such as vim and emacs support "modelines", a comment at the
beginning of the file that allows the file type to be explicitly
specified along with per-file specific settings

- The amount of configurations, style and settings mapping cannot be
handled in one go, so this opens up a lot of potential improvements.
- I left out the possiblity to have "zed" specific modelines for now,
but this could be potentially interesting.
- Mapping the mode or filetype to zed language names isn't obvious
either. We may want to make it configurable.

This is my first contribution to zed, be kind. I struggled a bit to find
the right place to add those settings. I use a similar approach as done
with editorconfig (merge_with_editorconfig). There might be better ways.

Closes #4762

Release Notes:

- Add basic emacs/vim modeline support.

Supersedes #41899, changes:
- limit reading to the first and last 1kb
- add documentation
- more variables handled
- add Arc around ModelineSettings to avoid extra cloning
- changed the way mode -> language mapping is done, thanks to
`modeline_aliases` language config
- drop vim ex: support
- made "Local Variables:" handling a separate commit, so we can drop it
easily
- various code style improvements

---------

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2026-03-25 03:15:51 +00:00
Max Brunsfeld
aca5209761
Make the agent panel have a flexible width (#52276)
Release Notes:

- The agent panel now has a flexible width, similar to the center panes
of the workspace.
2026-03-24 18:45:43 +00:00
claire
b0e35b6599
Allow search/replace to span multiple lines (#50783)
Closes #49957 

Also adds `start_of_input` context, and modifies both
`{start,end}_of_input` to work for both single line and auto height
editor modes.


https://github.com/user-attachments/assets/e30f2b20-a96c-49d5-9eb6-3c95a485d14a

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:

- Added support for multi-line search and replace input in Buffer Search
and Project Search

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2026-03-19 11:10:14 -06:00
Andrei Benea
0698eccebb
Save edited buffers before running a task (#48861)
Save edited buffers before running a task

Introduces a new task field for configuring which buffers are saved. For
now, this defaults to saving all buffers, but in the future we could
have a global task template to configure this setting for dynamically
created tasks.

Needed for #10251.

Release Notes:

- Edited buffers are now saved before running a task. This can be
configured with the new "save" field in `tasks.json`.

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2026-03-19 08:42:28 +00:00
Mikayla Maki
67d7f99891
Fix shared database test isolation (#51809)
All of the important changes are in
[`db.rs`](https://github.com/zed-industries/zed/pull/51809/changes#diff-2f644eab943bfa58feec29256281a3d9e8d4d7784cd34783e845af8beb15b16d).
Consider reading the commit log in order to review this work.

The DB crate's macro and API was changed to fix flakiness observed in
the MultiWorkspace tests when run locally. This flakiness was caused by
a shared `static LazyLock`, that caused concurrent test runs to interact
with the same underlying in-memory database. This flakiness wasn't
possible on CI due to it's usage of `cargo nextest`, whose
process-per-test approach masked this problem.

Essentially, I've changed the `static_connection` macro to remove the
static database variable and redone the internal model. Now, all
database types are thin wrappers around a generic `AppDatabase`. The
`AppDatabase` collects all of the individual table's migrations via the
`inventory` crate, and so only runs the migrations once on startup,
rather than a dozen times on startup.

The new API requires a `cx` so that we can replace the database returned
at runtime, rather than relying exclusively on a process-global
thread-local. However, we are still using a `static LazyLock` so that we
only need to take an `&App`, instead of an `&mut App`. These databases
types are `Clone + Send + Sync`, so you can easily capture-and-move the
database into background tasks and other places that don't have a `cx`.

For tests that require database isolation, it is now possible to set
their own database in init. See
[`workspace::init_test`](https://github.com/zed-industries/zed/pull/51809/changes#diff-041673bbd1947a35d45945636c0055429dfc8b5985faf93f8a8a960c9ad31e28R13610),
for the flakiness fix.

Best part, this change should be entirely compiler driven, so the Zed
agent was able to make the app-wide refactor easily.

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: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2026-03-18 12:05:57 -07:00
Max Brunsfeld
977cd6ac7e
Move sidebar back out of the panel (#51723)
Reverts https://github.com/zed-industries/zed/pull/51241

Release Notes:

- N/A
2026-03-17 03:48:20 +00:00
Danilo Leal
4e8937b62d
ui: Refactor the Button component icon methods (#51496)
Previously, if you wanted to have a button that contains icons on both
edges, you'd need to use a `ButtonLike` component, which takes any
children. Meanwhile, the `Button` would only take one icon, where you
could control its position through the `IconPosition` enum. This has
always felt unnecessarily limiting. So, this PR removes this limitation
by adding two new methods to the button: `start_icon` and `end_icon`.

In the meantime, I have also been bothered by the unnecessary
indirection in the `IconButton` due to the existence of the `ButtonIcon`
component. So I figured I could also completely eliminate that by adding
some of its methods directly to the `IconButton` and in the Button, just
using a regular `Icon` component.

---
## Before
```rust
Button::new("id", "Label")
    .icon(IconName::Plus)
    .icon_position(IconPosition::Start)
    .icon_size(IconSize::Small)
    .icon_color(Color::Muted)
```

## After
```rust
Button::new("id", "Label")
    .start_icon(Icon::new(IconName::Check))
    .end_icon(Icon::new(IconName::ChevronDown).size(IconSize::XSmall))
```

This should have no visual impact to the UI.

Release Notes:

- N/A
2026-03-13 14:13:12 -03:00
Nelson Campos
314b7e55fb
debugger: Fix restart only working once per session (#51247)
`Session::restart_task` is set to `Some` when a restart is initiated but
never cleared back to `None`. The guard at the top of `restart()` checks
`self.restart_task.is_some()` and returns early, so only the first
restart attempt succeeds.

This primarily affects debug adapters that advertise
`supportsRestartRequest` dynamically via a `CapabilitiesEvent` after
launch, such as the Flutter debug adapter.

Related: https://github.com/zed-extensions/dart/issues/45

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
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
(N/A — no UI changes)

Release Notes:

- debugger: Fixed debug session restart only working once when the
adapter supports DAP restart requests.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
2026-03-12 13:05:52 +00:00
Max Brunsfeld
b5666319b4
Move threads sidebar into agent panel (#51241)
* [x] Put back persistence of sidebar open state
* [x] when agent panel is docked right, put sidebar on the right side
* [x] remove stale entries from `SidebarsByWindow`

Release Notes:

- N/A

---------

Co-authored-by: Eric Holk <eric@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-03-10 23:45:55 -07:00
claire
49ef20585d
terminal: Fix drag-and-drop in vertical terminal panels (#49825)
Closes #49800

Adds `handle_drop` to Item & ItemHandle, which allows an active item in
a pane to consume drop events before the pane does.

Release Notes:

- terminal: Fix drag-and-drop not working in vertical terminal panels
2026-03-06 11:37:14 +02:00
Viraj Bhartiya
f3e4c152a3
project_panel: Fix scrolling in empty area below file list (#50683)
Closes #50624

The empty bottom section of the project panel showed a horizontal
scrollbar on hover, but scrolling didn't work there. Added a scroll
wheel handler to the blank area that forwards scroll events to the
uniform list's scroll handle, making both horizontal and vertical
scrolling work from anywhere in the panel.

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/zedindustries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed project panel empty area showing a non-functional scrollbar;
scrolling now works from anywhere in the panel

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-03-04 19:13:32 +01:00
Cole Miller
be5763632d
Start removing callers of legacy excerpt APIs (#50144)
Paving the way to remove `ExcerptId`. Done in this PR:

- Unshipped the stack trace view
- Get rid of `push_excerpts`
- Get rid of some callers of `remove_excerpts`

We still need to remove some calls to `remove_excerpts` and other APIs,
especially in `randomly_edit_excerpts` and collaboration.

Release Notes:

- The stack trace multibuffer view has been removed.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2026-02-26 10:37:43 -05:00
Peter Tripp
ae53f5651e
Redact environment variables from debugger errors (#50008)
Closes #50007

- Follow-up to: https://github.com/zed-industries/zed/pull/44783

Release Notes:

- Improved redaction of sensitive environment variables from debugger
error logs.
2026-02-25 16:18:42 +01:00
Samuel Domínguez Lorenzo
8829947278
Add debug panel toggle (#48020)
This adds `debug_panel::Toggle` which is the same as
`terminal_panel::Toggle` but for the debug panel. It also moves
`debug_panel::{Toggle, ToggleFocus}` to its own `pub mod` for
consistency with other keybinds.

[Related
discussion](https://github.com/zed-industries/zed/discussions/47931#discussion-9404091)

Release Notes:

- Added `debug_panel::Toggle` to show/hide debug panel like
`terminal_panel::Toggle`
2026-02-25 12:41:39 +00:00
Conrad Irwin
40d3aa6fea
Make Workspace::split infallible (#50060)
Fixes ZED-596

Release Notes:

- Fixed a panic in editor::GoToDefinitionSplit if you managed to close
the current pane before the definitions were resolved
2026-02-24 23:33:34 -07:00
Anthony Eid
c6a82b3b45
debugger: Open correct pane for breakpoints (#49390)
Closes #40602

### Summary

This PR ensures that active debug lines only open in a single pane and
new active debug lines are added to the most recent pane that contained
an active debug line. This fixes a bug where Zed could go to the active
debug line file and location in every pane a user had open, even if that
pane was focused on a different file.

I fixed this by storing the `entity_id` of the pane containing the most
recently active debug line on `BreakpointStore`, this is consistent with
where the selected stack frame is stored. I used an `entity_id` instead
of a strong type to avoid circular dependencies. Whenever an active
debug line is being set in the editor or by the debugger it now checks
if there's a specific pane it should be set in, and after setting the
line it updates `BreakpointStore` state.

I also added a new method on the `workspace::Item` trait called `fn
pane_changed(&mut self, new_pane_id: EntityId, cx: &mut Context<Self>)`
To enable `Editor` to update `BreakpointStore`'s active debug line pane
id whenever an `Editor` is moved to a new pane.


### PR review TODO list

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:

- debugger: Fix bug where active debug lines could be set in the wrong
pane
2026-02-24 12:49:52 +01:00
Lukas Wirth
aa91fd4a96
Reduce amount of closure monomorphizations part 2 (#49688)
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-20 08:32:45 +00:00
Cole Miller
e07d0ba2e4
Add telemetry for stack trace view (#49642)
Release Notes:

- N/A
2026-02-19 19:17:11 +00:00
Marco Mihai Condrache
9d779879f2
editor: Remove duplicate method (#49592)
`highlight_background` and `highlight_background_key` currently have the
same implementation

Release Notes:

- N/A
2026-02-19 12:29:20 +00:00
Danilo Leal
4eb1ffa992
Remove older onboarding modals (#49484)
This PR removes onboarding modals for features that were announced, at
this point, a long time ago: Git v1, Debugger, and Agent Panel v1. This
cleans up the actions list a bit when you search for "onboarding". I
left the ACP and Claude Code ones, though; they were the two more recent
ones, but we should be able to remove them soon enough, too.

Release Notes:

- N/A
2026-02-18 12:17:35 -03:00
Lukas Wirth
7d80412cca
Reduce amount of monomorphizations from FnMut closures (#49453)
Replaces a bunch of `impl FnMut` parameters with `&mut dyn FnMut` for
functions where this is the sole generic parameter.
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-18 12:00:02 +01:00
Cameron Mcloughlin
ee9191ecd2
workspace: Add Toggle actions to all the side panels (#49395)
Release Notes:

- Add `toggle` actions to all panels to toggle visibility

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-17 23:06:27 +00: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
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
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
Xiaobo Liu
92f8ae8635
debugger: Wrap TaskContext in Arc to reduce cloning overhead (#47087)
Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
2026-02-05 10:37:39 +00:00
Lukas Wirth
9cd2343432
editor: Put more syntax walking features on the background (#48450)
Currently we always compute breadcrumbs and sticky headers on every
editor paint which is not cheap to do especially in bigger files, moving
this off to be computed on event handling where they change and then
caching them can save serveral milliseconds per render in bigger files.

This also puts matching brackets refreshing and document highlights on a
background task, as this tends to block the main task for prolonged time
as well.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-05 09:31:11 +00:00
Piotr Osiewicz
825cf2db7e
ci: Parse Cargo.toml and Cargo.lock with Python script to determine affected packages (#48389)
Closes #ISSUE

Release Notes:

- N/A
2026-02-04 19:31:25 +00:00
Lukas Wirth
5d2feaa144
editor: Implement semantic highlighting (#46356)
Part of #7450

Big thanks to @macmv for pushing this forwards so much!

Rebased version of https://github.com/zed-industries/zed/pull/39539 as
working on an in-org branch simplifies a lot of things for us)

Release Notes:

- Added LSP semantic tokens highlighting support

---------

Co-authored-by: Neil Macneale V <neil.macneale.v@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-04 17:37:13 +00:00