This PR wires up the ability to configure Assistant2.
<img width="1309" alt="Screenshot 2025-01-22 at 1 52 56 PM"
src="https://github.com/user-attachments/assets/3de47797-7959-47af-bd93-51f105e87c28"
/>
Release Notes:
- N/A
Marshall Bowers
created
f770397
assistant: Extract `ConfigurationView` to its own module (#23480)
Click to expand commit body
This PR is a small refactoring that extracts the Assistant's
`ConfigurationView` into its own module.
Release Notes:
- N/A
Marshall Bowers
created
09fe1e7
Scroll completions menu to new selection on filter, fix corner case (#23478)
Click to expand commit body
In the future if `filter` was used more this would fix other issues. In
the current code paths, this just fixes the particular corner case of
edit prediction arriving async while `y_flipped = true` (in this case it
needs to be scrolled down to show item with index 0).
Release Notes:
- N/A
Michael Sloan
created
9f87145
title_bar: Simplify `git-ui` feature flag check (#23475)
Click to expand commit body
This PR is a follow-up to
https://github.com/zed-industries/zed/pull/23470 that simplifies the way
we check the `git-ui` feature flag in the title bar.
Release Notes:
- N/A
da406ae
Revert "project: Allow running multiple instances of a single language server within a single worktree" (#23472)
Click to expand commit body
Reverts zed-industries/zed#22182
I've merged the build too soon as I wanted it to be excluded from todays
Preview.
Piotr Osiewicz
created
706e46c
vim: Fix % not working for multi-char bracket pairs (#23471)
Click to expand commit body
Closes #23358
Demo/proof:
https://github.com/user-attachments/assets/2036d183-8830-415b-9155-0d3efe3d824c
Release Notes:
- Fixed `%` in Vim mode not working correctly for multi-char brackets,
such as `do/end` in Elixir or `\begin` and `\end` in LaTeX.
Co-authored-by: Conrad <conrad@zed.dev>
Thorsten Ball
and
Conrad
created
5be2784
git_ui: Feature flag repo selector (#23470)
Click to expand commit body
Fixes an issue where the repo selector showed for all users, not just
those in the git_ui feature flag.
This was meant to be included in the `git_ui` feature flag.
Release Notes:
- N/A
Nate Butler
created
bed917b
project: Allow running multiple instances of a single language server within a single worktree (#22182)
Click to expand commit body
This PR introduces a new entity called Project Tree which is responsible
for finding subprojects within a worktree;
a subproject is a language-specific subset of a worktree which should be
accurately tracked on the language server side. We'll have an ability to
set multiple disjoint `workspaceFolder`s on language server side OR
spawn multiple instances of a single language server (which will be the
case with e.g. Python language servers, as they need to interact with
multiple disjoint virtual environments).
Project Tree assumes that projects of the same LspAdapter kind cannot
overlap. Additionally **project nesting** is not allowed within the
scope of a single LspAdapter.
Closes #5108
Release Notes:
- Language servers now track their working directory more accurately.
---------
Co-authored-by: João <joao@zed.dev>
Piotr Osiewicz
and
João
created
d85fec5
Update "Book Onboarding" destination link (#23464)
Click to expand commit body
This PR updates the Book Onboarding links to point to a new form.
Release Notes:
- N/A
#23460 brought up we are showing the new "tab Accept" marker for single
line suggestions for non-zeta providers. We think this might be valid
for any provider, but we only want to enable it for zeta initially so it
doesn't affect an existing user base.
Release Notes:
- N/A
Agus Zubiaga
created
1e88e29
assistant2: Respect panel dock position (#23465)
Click to expand commit body
This PR fixes an issue where Assistant2 was not respecting the panel
dock position.
Release Notes:
- N/A
Marshall Bowers
created
636df12
Only show accept callout if suggestion is all insertions/deletions (#23461)
Click to expand commit body
Release Notes:
- N/A
Agus Zubiaga
created
55721c6
Fix single line edit prediction detection (#23456)
Click to expand commit body
#23411 introduced an "Accept" callout for single line edits, but the
logic to detect them was incorrect causing it to trigger for multiline
insertions, this PR fixes that.
Release Notes:
- N/A
Agus Zubiaga
created
f0b5b0b
lsp: Ignore payload of `DidChangeConfiguration` dynamic registration (#23454)
Click to expand commit body
Fixes #23430
Closes #23430
Release Notes:
- N/A
Piotr Osiewicz
created
c66f611
windows: Improve foreground task dispatching on Windows (continued) (#23415)
Click to expand commit body
Closes #22653 again
In PR #23283, I thought that every `runnable` dispatched to the main
thread would correspond to an `EVENT_DISPATCHED` message in the message
queue. However, after testing, some `runnable`s occasionally weren’t
executed.
This PR updated the code as follows:
```rust
if let Ok(runnable) = self.main_receiver.try_recv() { <-- before
for runnable in self.main_receiver.drain() { <-- after
runnable.run();
}
```
This ensures that runnables are handled more proactively on the main
thread, now we handle `runnable`s with a much higher priority.
A big thanks to @MolotovCherry and @ArthurBrussee for their testing
efforts!
Release Notes:
- N/A
张小白
created
2f1af2a
When completions menu is displayed above cursor, reverse order (#23446)
Click to expand commit body
Considered doing this when previously working on completions menu
layout, as it brings the default selection position next to the cursor
position, and is generally more symmetrical. With #23445 there is now a
more compelling reason, as the "translucent, cropped bottom" display
doesn't make sense when displayed above.
Release Notes:
- N/A
Michael Sloan
created
1769bc9
Make app notifications appear in new workspaces + dismiss on all workspaces (#23432)
Click to expand commit body
The keymap error notifications got convoluted to support displaying the
notification on startup. This change addresses it systemically for all
future app notifications.
Reverts most of #20531, while keeping the fix to handle keyboard layout
switching. This is a better fix for #20531
Release Notes:
- N/A
Michael Sloan
created
1e1997c
Wire up `AssistantPanelDelegate` based on `assistant2` feature flag (#23444)
Click to expand commit body
This PR adjusts how the `AssistantPanelDelegate` global is set to be
based on the state of the feature flag.
This should prevent `assistant` and `assistant2` from potentially
clobbering each other.
Release Notes:
- N/A
Marshall Bowers
created
9ee1db3
assistant2: Insert default prompt into prompt editor (#23443)
Click to expand commit body
This PR fixes an issue where the default prompt was not being inserted
into the prompt editor in Assistant2.
Release Notes:
- N/A
Marshall Bowers
created
c887bf8
Consolidate Assistant panels in `assistant2` feature flag (#23442)
Click to expand commit body
This PR consolidates the two Assistant panels into one for users in the
`assistant2` feature flag.
Now that the Assistant1 prompt editor is accessible through the
Assistant2 panel, we no longer have a need to show both panels.
Release Notes:
- N/A
Marshall Bowers
created
7516b8c
assistant2: Add prompt editor history (#23439)
Click to expand commit body
This PR adds the prompt editor history to Assistant2.
<img width="1309" alt="Screenshot 2025-01-21 at 9 02 07 PM"
src="https://github.com/user-attachments/assets/d79936fe-1c23-425f-b99d-43f85afd0c39"
/>
Release Notes:
- N/A
Marshall Bowers
created
be407e2
Extract `ContextHistory` to `assistant_context_editor` (#23437)
Click to expand commit body
This PR extracts the `ContextHistory` to the `assistant_context_editor`
crate.
Release Notes:
- N/A
This PR adds the Assistant1 experience to Assistant2 as a "prompt
editor".
<img width="1309" alt="Screenshot 2025-01-21 at 7 17 26 PM"
src="https://github.com/user-attachments/assets/3ce2f32b-2b1a-48a8-8e56-4c44e3ac4ce5"
/>
Release Notes:
- N/A
Marshall Bowers
created
3d47f32
Add support for `editor::SwapSelectionEnds` everywhere (emacs exchange-point-and-mark) (#23428)
Click to expand commit body
Add `editor:: SwapSelectionEnds ` action which swaps the cursor location from the beginning/end of a given selection.
Renamed from `editor::ExchangeMark` to `editor::SwapSelectionEnds`.
Unbound by default, bound to `ctrl-x ctrl-x` in Emacs keymap.
Peter Tripp
created
31909bf
git: Implement a basic repository selector (#23419)
Click to expand commit body
This PR adds a rough-and-ready picker for selecting which of the
project's repositories the git panel should display.
Release Notes:
- N/A
---------
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Nate <nate@zed.dev>
Cole Miller
,
Nate Butler
, and
Nate
created
417760a
Extract `ContextEditor` to `assistant_context_editor` (#23433)
Click to expand commit body
This PR extracts the `ContextEditor` to the `assistant_context_editor`
crate.
As part of this, we have decoupled the `ContextEditor` from the
`AssistantPanel`.
There is now an `AssistantPanelDelegate` that the `ContextEditor` uses
when it needs to interface with the Assistant panel.
Release Notes:
- N/A
This PR adds a new `assistant_context_editor` crate.
This will ultimately house the `ContextEditor` so that it can be
consumed by both `assistant` and `assistant2`.
For the purposes of this PR, we just introduce the crate and move some
supporting constructs to it, such as the `ContextStore`.
Release Notes:
- N/A
Marshall Bowers
created
c450cd5
open_ai: Move from o1-preview to o1 for OpenAI Assistant provider (#23425)
Click to expand commit body
- Closes: https://github.com/zed-industries/zed/issues/22521
- Follow-up to: https://github.com/zed-industries/zed/pull/22376
Peter Tripp
created
6eaaced
Fix button demo in the component preview (#23423)
Click to expand commit body
Problem: If you click on "Tinted Icons", "Icon Color" is also activated.
Release Notes:
- N/A
k4leg
created
836b4c1
ci: Remove `paths-ignore` for docs, as it does not work with required status checks (#23424)
Click to expand commit body
This PR removes the `paths-ignore` for docs again, as it causes
docs-only PRs to be unmergable in combination with required status
checks (which we need in order to support merge-when-ready).
We can put these back if and only if we come up with a solution for how
to make it work with required status checks.
Release Notes:
- N/A
Marshall Bowers
created
718da3f
docs: Fix broken link for the Odin language (#23421)
Hristo Kanchev
created
51b6cbf
assistant: Extract `ContextEditor` and `ContextHistory` to their own modules (#23422)
Click to expand commit body
This PR extracts the `ContextEditor` and `ContextHistory`
implementations into their own modules so that it's clearer which parts
depend on other constructs in the `assistant` crate.
Release Notes:
- N/A
Marshall Bowers
created
c825bb4
assistant2: Propagate move up action to inline picker from message editor (#23416)
Click to expand commit body
Release Notes:
- N/A
Co-authored-by: Richard <richard@zed.dev>
Agus Zubiaga
and
Richard
created
86ff88a
Show "tab Accept" indicator for single line insertions/deletions (#23411)
14cd178
ollama: Add deepseek-r1 context size to defaults (#23420)
Peter Tripp
created
aa5fa4b
git: Use a buffer for the panel's commit message (#23308)
Click to expand commit body
This PR changes the `GitPanel` and `GitState` to use a
`language::Buffer` for the commit message. This is a small initial step
toward remote editing and collaboration support.
Release Notes:
- N/A
---------
Co-authored-by: Max <max@zed.dev>
* Remove `NotificationHandle` trait in favor of just passing `AnyView` -
id field wasn't used.
* Remove `show_notification_once`, doesn't seem to be needed for its
only use.
Release Notes:
- N/A
Michael Sloan
created
8c215d4
Fix pulling metadata out of broken symlinks (#22396)
Click to expand commit body
## Problem
When developing extensions locally, developers will commonly put their
source code in a specific directory. Zed uses this directory to create a
symlink starting from `$HOME/Library/Application
Support/Zed/extensions/installed` (MacOS path). When a developer then
moves this source code and tries to reinstall the extension, Zed will
fail with an unhelpful message (you can check the #Testing section).
## Change Summary
With this PR, we fix this behaviour by handling broken symlinks
specifically when returning the metadata on `fs::metadata`. Today, we
1. Pull the symlink metadata.
2. Return it if the file was not a symlink OR if it is, pull the
metadata for the pointed file.
After this change gets merged, we return the Symlink metadata if the
symlink is broken. This makes the symlink be recreated since we remove
the symlink either way.
## Risks associated with this change
It's possible changing this behaviour will show additional cases where
we are handling broken symlinks incorrectly. I expect this to be a
better scenario AND backwards compatible. We have the same behaviour we
had for 1. existing symlinks 2. normal files.
## Testing
The way I have been reproducing this is by having a private extension of
my own. I install it using the `zed: install dev extension` command
after running `RUST_LOG=debug RUST_BACKTRACE=1 scripts/zed-local -1`.
Then I move the extension to a different directory.
Zed will now keeps a broken link on its `installed` directory:
```
❯ ll
Permissions Size User Date Modified Name
lrwxr-xr-x@ - enrikes 24 Dec 12:15 brazil-config-zed-extension -> /Volumes/workplace/BrazilConfigZedExtension
drwxr-xr-x@ - enrikes 5 Dec 14:48 java
drwxr-xr-x@ - enrikes 12 Dec 13:04 kotlin
drwxr-xr-x@ - enrikes 25 Oct 08:13 rose-pine-theme
```
Before the patch, Zed shows on its logs:
```
2024-12-24T16:44:02+01:00 INFO extension::extension_builder] compiled Rust extension /Users/enrikes/Documents/BrazilConfigZedExtension
[2024-12-24T16:44:02+01:00 INFO extension::extension_builder] compiling grammar brazil_config for extension /Users/enrikes/Documents/BrazilConfigZedExtension
[2024-12-24T16:44:02+01:00 INFO extension::extension_builder] checking out brazil_config parser
[2024-12-24T16:44:04+01:00 INFO extension::extension_builder] compiling brazil_config parser
[2024-12-24T16:44:05+01:00 INFO extension::extension_builder] compiled grammar brazil_config for extension /Users/enrikes/Documents/BrazilConfigZedExtension
[2024-12-24T16:44:05+01:00 INFO extension::extension_builder] finished compiling extension /Users/enrikes/Documents/BrazilConfigZedExtension
[2024-12-24T16:44:05+01:00 ERROR extensions_ui] No such file or directory (os error 2)
Stack backtrace:
0: std::backtrace_rs::backtrace::libunwind::trace
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
1: std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: std::backtrace::Backtrace::create
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/backtrace.rs:331:13
3: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
at /Users/enrikes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.94/src/backtrace.rs:27:14
4: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1989:27
5: <fs::RealFs as fs::Fs>::metadata::{{closure}}
at ./crates/fs/src/fs.rs:603:13
```
After the patch, the extension is installed and the symlink replaced for
a new one pointing to the user's directory choice.
```
2024-12-24T16:53:33.916022+01:00 [INFO] compiled Rust extension /Users/enrikes/Documents/BrazilConfigZedExtension
2024-12-24T16:53:33.916094+01:00 [INFO] compiling grammar brazil_config for extension /Users/enrikes/Documents/BrazilConfigZedExtension
2024-12-24T16:53:33.916225+01:00 [INFO] checking out brazil_config parser
2024-12-24T16:53:35.481602+01:00 [INFO] compiling brazil_config parser
2024-12-24T16:53:35.964189+01:00 [INFO] compiled grammar brazil_config for extension /Users/enrikes/Documents/BrazilConfigZedExtension
2024-12-24T16:53:35.964319+01:00 [INFO] finished compiling extension /Users/enrikes/Documents/BrazilConfigZedExtension
2024-12-24T16:53:36.213608+01:00 [INFO] rebuilt extension index in 39.108542ms
2024-12-24T16:53:36.213835+01:00 [INFO] extensions updated. loading 0, reloading 1, unloading 0
2024-12-24T16:53:36.375928+01:00 [INFO] rebuilt extension index in 34.478167ms
2024-12-24T16:53:36.376054+01:00 [INFO] extensions updated. loading 0, reloading 1, unloading 0
```
and
```
❯ ll
lrwxr-xr-x@ - enrikes 24 Dec 16:53 brazil-config-zed-extension -> /Users/enrikes/Documents/BrazilConfigZedExtension
drwxr-xr-x@ - enrikes 5 Dec 14:48 java
drwxr-xr-x@ - enrikes 12 Dec 13:04 kotlin
drwxr-xr-x@ - enrikes 25 Oct 08:13 rose-pine-theme
```
Release Notes:
- Fix broken symlinks when installing dev extensions
---------
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Enrique Kessler Martínez
and
Mikayla Maki
created
75c5344
Fix completion labels becoming overly large due to LSP completion items with newlines (#23407)
Click to expand commit body
Reworks https://github.com/zed-industries/zed/pull/23030 and
https://github.com/zed-industries/zed/pull/15087
Closes https://github.com/zed-industries/zed/issues/23352
Closes https://github.com/zed-industries/zed/issues/23310
Zed's completion items use `label` from LSP completion items as a base
to show in the list:
https://github.com/zed-industries/zed/blob/d290da7dac922fdc67c4774cdd371fba23fe62e3/crates/project/src/lsp_store.rs#L4371-L4374
Besides that, certain language plugins append `detail` or
`label_details.description` as a suffix:
https://github.com/zed-industries/zed/blob/d290da7dac922fdc67c4774cdd371fba23fe62e3/crates/languages/src/vtsls.rs#L178-L188
Either of these 3 properties may return `\n` (or multiple) in it,
spoiling Zed's completion menu, which uses `UniformList` to render those
items: a uniform list uses common, minimum possible height for each
element, and `\n` bloats that overly.
Good approach would be to use something else:
https://github.com/zed-industries/zed/issues/21403 but that has its own
drawbacks and relatively hard to use instead (?).
We could follow VSCode's approach and move away all but `label` from
`CodeLabel.text` to the side, where the documentation is, but that does
not solve the issue with `details` having newlines.
So, for now, sanitize all labels and remove any newlines from them. If
newlines are found, also replace whitespace sequences if there's more
than 1 in a row.
Later, this approach can be improved similarly to how Helix and Zed's
inline completions do: rendering a "ghost" text, showing the
completion's edit applied to the editor.
Release Notes:
- Fixed completion labels becoming overly large due to LSP completion
items with newlines
Updates #21927
Replaces https://github.com/zed-industries/zed/pull/22904
Closes #8580
Adds actions (default keybinds with emacs keymap):
- editor::SetMark (`ctrl-space` and `ctrl-@`)
- editor::ExchangeMark (`ctrl-x ctrl-x`)
Co-Authored-By: Peter <peter@zed.dev>
Release Notes:
- Add Emacs mark mode (`ctrl-space` / `ctrl-@` to set mark; `ctrl-x
ctrl-x` to swap mark/cursor)
- Breaking change: `selection` keyboard context has been replaced with
`selection_mode`
---------
Co-authored-by: Peter <peter@zed.dev>
Conrad Irwin
and
Peter
created
c4542ca
zeta: Make the Jump to Edit callout pop up more (#23404)
Click to expand commit body
| Before | After |
|--------|--------|
| <img width="1328" alt="Screenshot 2025-01-21 at 11 20 49 AM"
src="https://github.com/user-attachments/assets/ad8e3017-122a-4ebd-b1f5-5eb41cc3725a"
/> | <img width="1328" alt="Screenshot 2025-01-21 at 11 19 39 AM"
src="https://github.com/user-attachments/assets/a0dcbd52-6aca-43fa-97ee-6efde15c8bc1"
/> |
Release Notes:
- N/A
Danilo Leal
created
d011b97
project_panel: Adjust entry background and border colors (#23403)
Click to expand commit body
Follow up to https://github.com/zed-industries/zed/pull/22658
This PR ensures the background and border color of a project panel entry
is exactly the same with one exception: if the item is focused, active,
and not with mouse down. The point is to not be able to see the border
at all given they're there to act sort of akin to CSS's `outline` (which
doesn't add up to the box model).
Please let me know if there is any edge case I either messed up here or
didn't account for.
https://github.com/user-attachments/assets/29c74f6a-b027-4d19-a7de-b9614f0d7859
Release Notes:
- N/A
Danilo Leal
created
f33d02c
lsp_store: Do not associate a language server with the language for symbol highlighting (#23401)
Click to expand commit body
This unblocks work on #22182; a single language server might actually be
required by multiple languages (think of e.g. C/C++,
Javascript/Typescript), in which case it doesn't make sense to use a
single grammar. We already use primary language of a buffer for
highlights and this PR makes this the only supported syntax highlighting
flavour for returned symbols.
Closes #ISSUE
Release Notes:
- N/A
Piotr Osiewicz
created
e2c7934
Show inline completion popover for hard to spot single edits (#23385)
Click to expand commit body
If a suggested edit is a single character insert or a single line
deletion, we'll show the diff popover to make it stand out more.
Release Notes:
- N/A
Co-authored-by: Danilo <danilo@zed.dev>
Agus Zubiaga
and
Danilo
created
d40177c
Fix project entry rename in Remote Development (#23382)
Click to expand commit body
Closes #22883
To fix the problem, we move `handle_rename_project_entry` from
`Worktree` to `LspStore` and register it there. This way it becomes
available both in local and headless projects and this avoids the
duplication.
Release Notes:
- Fixed renaming project entries in Remote Development
Andrew Borg (Kashin)
created
cc1af7d
Display keymap errors on initial load (#23394)
Click to expand commit body
Also fixes issue introduced in #23113 where changes to keyboard layout
would not cause reload of keymap configuration.
Closes #20531
Release Notes:
- N/A
I've noticed an occasional error: `ignoring event C:\some\path\to\file
outside of root path \\?\C:\some\path`. This happens because UNC paths
always fail to match with non-UNC paths during operations like
`strip_prefix` or `starts_with`. To address this, I changed the types of
some key parameters to `SanitizedPath`. With this adjustment, FS events
are now correctly identified, and under the changes in this PR, the
`test_rescan_and_remote_updates` test also passes successfully on
Windows.
Release Notes:
- N/A
张小白
created
8f87b56
Wire up `@mention`ed files in assistant2 (#23389)
Click to expand commit body
`@mention`ed files in assistant2 now get replaced by the full path of
the file in what gets sent to the model, while rendering visually as
just the filename (in a crease, so they can only be selected/deleted as
a whole unit, not character by character).
https://github.com/user-attachments/assets/a5867a93-d656-4a17-aced-58424c6e8cf6
Release Notes:
- N/A
---------
Co-authored-by: João Marcos <joao@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
Richard Feldman
,
João Marcos
, and
Conrad
created
aacd80e
Prefer later bindings in keymap section for display in UI (#23378)
Click to expand commit body
Closes #23015
Release Notes:
- Improved which keybindings are selected for display. Now later entries
within `bindings` will take precedence. The default keymaps have been
updated accordingly.