This is another pure refactor, to prepare for adding direct WSL support.
### Todo
* [x] Represent `paths` in the same way for all workspaces, instead of
having a completely separate SSH representation
* [x] Adjust sqlite tables
* [x] `ssh_projects` -> `ssh_connections` (drop paths)
* [x] `workspaces.local_paths` -> `paths`
* [x] remove duplicate path columns on `workspaces`
* [x] Add migrations for backward-compatibility
Release Notes:
- N/A
---------
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This removes around 900 unnecessary clones, ranging from cloning a few
ints all the way to large data structures and images.
A lot of these were fixed using `cargo clippy --fix --workspace
--all-targets`, however it often breaks other lints and needs to be run
again. This was then followed up with some manual fixing.
I understand this is a large diff, but all the changes are pretty
trivial. Rust is doing some heavy lifting here for us. Once I get it up
to speed with main, I'd appreciate this getting merged rather sooner
than later.
Release Notes:
- N/A
Closes#24672
This PR complements a feature added earlier by @JosephTLyons (in
https://github.com/zed-industries/zed/pull/32353) where the text is
considered as the tab title in a new buffer. It piggybacks off that
change and sets the title as the suggested filename in the save dialog
(completely mirroring the same functionality in VSCode):

Release Notes:
- Text entered in a new untitled buffer is considered as the default
filename when saving
Adds component NotificationFrame. It implements a subset of MessageNotification as a Component and refactors MessageNotification to use NotificationFrame. Having some notification UI Component is nice as it allows us to easily build new types of notifications.
Uses the new NotificationFrame component for CaptureAudioNotification.
Adds a CaptureAudio action in the dev namespace (not meant for
end-users). It records 10 seconds of audio and saves that to a wav file.
Release Notes:
- N/A
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
- project search query string now turns red when no results are found
matching buffer search behavior
- General code deduplication as well as more consistent layout between
the two bars, as some minor details have drifted apart
- Tab cycling in buffer search now ends up in editor focus when cycling
backwards, matching forward cycling
- Report parse errors in filter include and exclude editors
Release Notes:
- N/A
This pull request should be idempotent, but lays the groundwork for
avoiding to connect to collab in order to interact with AI features
provided by Zed.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
This PR updates the user menu in the title bar to show the plan from the
`CloudUserStore` instead of the `UserStore`.
We're still leveraging the RPC connection to listen for `UpdateUserPlan`
messages so that we can get live-updates from the server, but we are
merely using this as a signal to re-fetch the information from Cloud.
Release Notes:
- N/A
Closes#33787
We were not updating SSH paths after initial project was created. Now we
update paths when worktrees are added/removed and serialize these
updated paths. This is separate from workspace because unlike local
paths, SSH paths are not part of the workspace table, but the SSH table
instead. We don't need to update SSH paths every time we serialize the
workspace.
<img width="400"
src="https://github.com/user-attachments/assets/9e1a9893-e08e-4ecf-8dab-1e9befced58b"
/>
Release Notes:
- Fixed issue where multiple remote folders in a project were lost on
reconnect, not restored on restart, and not visible in recent projects.
Closes#21198
Release Notes:
- Adds support for `:norm`
- Allows for vim and zed style modified keys specified in issue
- Vim style <C-w> and zed style <ctrl-w>
- Differs from vim in how multi-line is handled
- vim is sequential
- zed is combinational (with multi-cursor)
Closes#7759
While opening a new SSH project if we are reusing an existing window,
i.e. drop the existing workspace and create a new one, then before
dropping it, we should remove `session_id` from that workspace's
serialized entry. That way:
1. Upon closing (cmd-w) this remote workspace (which also clears
`session_id` for this), and then quitting. No workspace with that
`session_id` is found, and it starts fresh.
2. Upon directly quitting (cmd-q) this remote workspace, only this
workspace exists in db (among two of them) with that `session_id`, and
it restores correctly.
Release Notes:
- Fixed an issue while closing remote workspace restores last local
workspace on startup.
Closes#34924
Now, when `local_paths` are empty, we detach `session_id` from that
workspace serialization item. This way, when we restore it using the
default "last_session", we don't restore this workspace back. This is
same as when we use `cmd-w` to close window, which also sets
`session_id` to `None` before serialization.
Release Notes:
- Fixed an issue where last removed folder from workspace used to reopen
on Zed startup.
This is following feedback from folks that were searching the "close
others" action, available in the tab's context menu, and not finding it
because it was actually named "close inactive", which was confusing. So,
this PR makes sure the tab's menu item and the action have consistent
naming.
Release Notes:
- Rename "CloseInactiveItems" action to "CloseOtherItems" for naming
consistency.
This PR adds action `editor: toggle focus` which focuses to last active
editor pane item in workspace.
Release Notes:
- Added `editor: toggle focus` action, which focuses to last active
editor pane item.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Closes#33972
As noted on
https://github.com/zed-industries/zed/pull/31390#discussion_r2147473526,
when splitting panes and having a border size set for the active pane,
or the minimap visibility configured to the active editor only, zed will
shortly show a flicker of the border or the minimap on the pane that's
being deactivated.
Release Notes:
- Fixed an issue where pane activations would sometimes have a brief
delay, causing a flicker in the process.
Closes#33445
Fixed the "Close others" context menu action to close tabs relative to
the right-clicked tab instead of the currently active tab. Previously,
when right-clicking on an inactive tab and selecting "Close others", it
would keep the active tab open rather than the right-clicked tab.
## Before/After
https://github.com/user-attachments/assets/d76854c3-c490-4a41-8166-309dec26ba8a
## Changes
- Modified `close_inactive_items()` method to accept an optional
`target_item_id` parameter
- Updated context menu handler to pass the right-clicked tab's ID as the
target
- Maintained backward compatibility by defaulting to active tab when no
target is specified
- Updated all existing call sites to pass `None` for the new parameter
Release Notes:
- Fixed: "Close others" context menu action now correctly keeps the
right-clicked tab open instead of the active tab
Fixes an issue that caused Windows to fail when removing extension's
directories, as Zed had never stop any related processes.
Now:
* Zed shuts down and waits until the end when the language servers are
shut down
* Adds `impl Drop for WasmExtension` where does
`self.tx.close_channel();` to stop a receiver loop that holds the "lock"
on the extension's work dir.
The extension was dropped, but the channel was not closed for some
reason.
* Does more unregistration to ensure `Arc<WasmExtension>` with the `tx`
does not leak further
* Tidies up the related errors which had never reported a problematic
path before
Release Notes:
- N/A
---------
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Smit <smit@zed.dev>
Partial fix for #31330
It fix the problem that the inset stay on after switching to SSD, but it
still have the problem that after that first redraw, it have the wrong
size. Just resizing it even once work. I guess the relevant code to fix
that would be ``handle_toplevel_decoration_event`` of
``crates/gpui/src/platform/linux/wayland/window.rs``, but trying to call
resize here does not seems to work correctly (might be just wrong
argument), and I would like to take a break on that for now.
Release Notes:
- N/A
(better wait for that to be completely fixed before adding it in the
changelog)
---------
Co-authored-by: Michael Sloan <michael@zed.dev>
Closes #ISSUE
Adds a new `documentation` method to actions, that is extracted from doc
comments when using the `actions!` or derive macros.
Additionally, this PR adds doc comments to as many action definitions in
Zed as possible.
Release Notes:
- N/A *or* Added/Fixed/Improved ...
* Add a "close item"-like binding to close the active dock, if present
Now, cmd/ctrl-w can be used close the focused dock before the Zed window
* Add defaults to MoveItem* actions to make it appear in the command
palette
Release Notes:
- N/A
We reworked the debug modal spawning to use the task context from past
debug sessions when spawning a debug scenario based on task inventory
history.
We changed restart session keybinding to rerun session too.
Closes#31369
Release Notes:
- Restarting a debug session now reruns build tasks that are associated
with the session
---------
Co-authored-by: Cole Miller <cole@zed.dev>
This is an easy way to shave some microseconds off the critical path for
frame rendering. On my machine this reduces typical frame rendering
latency by ~100 microseconds, probably quite a bit more on slower
machines.
Here is how long it typically takes to drop elements from the arena,
from a fairly brief run:

Release Notes:
- N/A
Instead of a menagerie of macros for implementing `Action`, now there
are just two:
* `actions!(editor, [MoveLeft, MoveRight])`
* `#[derive(..., Action)]` with `#[action(namespace = editor)]`
In both contexts, `///` doc comments can be provided and will be used in
`JsonSchema`.
In both contexts, parameters can provided in `#[action(...)]`:
- `namespace = some_namespace` sets the namespace. In Zed this is
required.
- `name = "ActionName"` overrides the action's name. This must not
contain "::".
- `no_json` causes the `build` method to always error and
`action_json_schema` to return `None`
and allows actions not implement `serde::Serialize` and
`schemars::JsonSchema`.
- `no_register` skips registering the action. This is useful for
implementing the `Action` trait
while not supporting invocation by name or JSON deserialization.
- `deprecated_aliases = ["editor::SomeAction"]` specifies deprecated old
names for the action.
These action names should *not* correspond to any actions that are
registered. These old names
can then still be used to refer to invoke this action. In Zed, the
keymap JSON schema will
accept these old names and provide warnings.
- `deprecated = "Message about why this action is deprecation"`
specifies a deprecation message.
In Zed, the keymap JSON schema will cause this to be displayed as a
warning. This is a new feature.
Also makes the following changes since this seems like a good time to
make breaking changes:
* In `zed.rs` tests adds a test with an explicit list of namespaces. The
rationale for this is that there is otherwise no checking of `namespace
= ...` attributes.
* `Action::debug_name` renamed to `name_for_type`, since its only
difference with `name` was that it
* `Action::name` now returns `&'static str` instead of `&str` to match
the return of `name_for_type`. This makes the action trait more limited,
but the code was already assuming that `name_for_type` is the same as
`name`, and it requires `&'static`. So really this just makes the trait
harder to misuse.
* Various action reflection methods now use `&'static str` instead of
`SharedString`.
Release Notes:
- N/A
This PR adds an optional `clone: bool` argument to
`workspace::MoveItemToPane` and `workspace::MoveItemToPaneInDirection`
which causes the item to be cloned into the destination pane rather than
moved. It provides similar functionality to
`workbench.action.splitEditorToRightGroup` in vscode.
This PR supercedes #25030.
Closes#24889
Release Notes:
- Add optional `clone: bool` (default: `false`) to
`workspace::MoveItemToPane` and `workspace::MoveItemToPaneInDirection`
which causes the item to be cloned into the destination pane rather than
moved.
Closes#32688
Release Notes:
- Fixed tasks (including build tasks for debug configurations) silently
using `/` as a working directory when the specified `cwd` didn't exist.
Closes#32297
Changes:
- Added restoration of `workspace.centered_layout` from
`serialized.centered_layout`
- Ensures the centered layout state persists across project switches
Release Notes:
- Fixed centered layout not persisting when switching between projects