Commit graph

30597 commits

Author SHA1 Message Date
Antonio Scandurra
6c255c1973
Lay the groundwork to support history in agent2 (#36483)
This pull request introduces title generation and history replaying. We
still need to wire up the rest of the history but this gets us very
close. I extracted a lot of this code from `agent2-history` because that
branch was starting to get long-lived and there were lots of changes
since we started.

Release Notes:

- N/A
2025-08-19 14:24:23 +00:00
Piotr Osiewicz
c4083b9b63
Fix unnecessary-mut-passed lint (#36490)
Release Notes:

- N/A
2025-08-19 14:20:01 +00:00
Smit Barmase
e3b593efbd
project: Take 2 on Handle textDocument/didSave and textDocument/didChange (un)registration and usage correctly (#36485)
Relands https://github.com/zed-industries/zed/pull/36441 with a
deserialization fix.

Previously, deserializing `"includeText"` into
`lsp::TextDocumentSyncSaveOptions` resulted in a `Supported(false)` type
instead of `SaveOptions(SaveOptions { include_text: Option<bool> })`.

```rs
impl From<bool> for TextDocumentSyncSaveOptions {
    fn from(from: bool) -> Self {
        Self::Supported(from)
    }
}
```

Looks like, while dynamic registartion we only get `SaveOptions` type
and never `Supported` type.
(https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentSaveRegistrationOptions)

Release Notes:

- N/A

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
2025-08-19 19:04:48 +05:30
Piotr Osiewicz
8f567383e4
Auto-fix clippy::collapsible_if violations (#36428)
Release Notes:

- N/A
2025-08-19 13:27:24 +00:00
Lukas Wirth
9e8ec72bd5
Revert "project: Handle textDocument/didSave and textDocument/didChange (un)registration and usage correctly (#36441)" (#36480)
This reverts commit c5991e74bb.

This PR broke rust-analyzer's check on save function, so reverting for
now

Release Notes:

- N/A
2025-08-19 14:32:26 +02:00
Vincent Durewski
2fb89c9b3e
chore: Default settings: Comments: dock option (#36476)
Minor tweak in the wording of the comments for the default settings
regarding the `dock` option of the panels, in order to make them
congruent across all panels.

Release Notes:

- N/A
2025-08-19 11:08:10 +00:00
Bennet Bo Fenner
e6d5a6a4fd
agent: Remove thread-auto-capture feature (#36474)
We never ended up using this in practice (the feature flag is not
enabled for anyone, not even staff)

Release Notes:

- N/A
2025-08-19 10:59:34 +00:00
Bennet Bo Fenner
790a2a0cfa
agent2: Support preferred_completion_mode setting (#36473)
Release Notes:

- N/A
2025-08-19 10:40:02 +00:00
Bennet Bo Fenner
97a31c59c9
agent2: Fix agent location still being present after thread stopped (#36471)
Release Notes:

- N/A
2025-08-19 10:22:17 +00:00
Lukas Wirth
5df9c7c1c2
search: Fix project search query flickering (#36470)
Release Notes:

- N/A

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2025-08-19 10:16:49 +00:00
Bennet Bo Fenner
0ea0d466d2
agent2: Port retry logic (#36421)
Release Notes:

- N/A
2025-08-19 09:41:55 +00:00
Smit Barmase
47e1d4511c
editor: Fix edit_predictions_disabled_in not disabling predictions (#36469)
Closes #25744

Only setting changes and editor init determined whether to show
predictions, so glob patterns and toggles correctly disabled them. On
cursor changes we call `update_visible_edit_prediction`, but we weren’t
discarding predictions when the scope changed. This PR fixes that.

Release Notes:

- Fixed an issue where the `edit_predictions_disabled_in` setting was
ignored in some cases.
2025-08-19 14:43:41 +05:30
Bennet Bo Fenner
b8ddb0141c
agent2: Port rules UI (#36429)
Release Notes:

- N/A
2025-08-19 11:12:57 +02:00
Piotr Osiewicz
ed14ab8c02
gpui: Introduce stacker to address stack overflows with deep layout trees (#35813)
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>

Release Notes:

- N/A

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2025-08-19 08:26:37 +00:00
tidely
1fbb318714
Fix iterator related clippy style lint violations (#36437)
Release Notes:

- N/A
2025-08-19 10:06:35 +02:00
0x5457
176c445817
Avoid symlink conflicts when re-extracting eslint-xx.tar.gz (#36068)
Closes #34325

**Background**
When upgrading/reinstalling the ESLint language server, extracting the
archive over an existing version directory that contains symlinks can
fail and interrupt the installation.
```
failed to unpack .../vscode-eslint-2.4.4/.../client/src/shared
File exists (os error 17) when symlinking ../../$shared/ to .../client/src/shared
```

**Root cause**
Extracting into a non-empty directory conflicts with leftover
files/symlinks (e.g., `client/src/shared -> ../../$shared`), causing
“File exists (os error 17)”.

When `fs::metadata(&server_path).await.is_err()` is true, the code falls
back to cached_server_binary, but that still targets the same
(potentially corrupted/half-installed) directory and does not run `npm
install` or `npm run compile`, so the system cannot recover and remains
broken.

**Change**
Before downloading and extracting, delete the target version directory
(vscode-eslint-<version>) to ensure an empty extraction destination and
avoid conflicts.

**Alternative approaches**
temp directory + rename: extract into a clean temp directory and rename
into place to avoid half-installed states

[async-tar](https://github.com/dignifiedquire/async-tar) enhancement:
tolerate already-existing symlinks (or add a “replace-existing” option).

Release Notes:

- Fixed eslint installation not clearing files after previous attempts'
2025-08-19 10:28:24 +03:00
Cole Miller
d30b017d1f
Prevent sending slash commands in CC threads (#36453)
Highlight them as errors in the editor, and add a leading space when
sending them so users don't hit the odd behavior when sending these
commands to the SDK.

Release Notes:

- N/A
2025-08-19 02:00:41 -04:00
Cole Miller
7bcea7dc2c
agent2: Support directories in @file mentions (#36416)
Release Notes:

- N/A
2025-08-19 04:09:43 +00:00
Cole Miller
821e97a392
agent2: Add hover preview for image creases (#36427)
Note that (at least for now) this only works for creases in the "new
message" editor, not when editing past messages. That's because we don't
have the original image available when putting together the creases for
past messages, only the base64-encoded language model content.

Release Notes:

- N/A
2025-08-19 03:26:15 +00:00
Michael Sloan
1b6fd996f8
Fix InlineCompletion -> EditPrediction keymap migration (#36457)
Accidentally regressed this in #35512, causing this migration to not
work and an error log to appear when one of these actions is in the user
keymap

Release Notes:

- N/A
2025-08-19 03:23:07 +00:00
Marshall Bowers
5004cb647b
collab: Add orb_subscription_id to billing_subscriptions (#36455)
This PR adds an `orb_subscription_id` column to the
`billing_subscriptions` table.

Release Notes:

- N/A
2025-08-19 02:43:27 +00:00
Ben Kunkle
4abfcbaff9
git: Suggest merge commit message in remote (#36430)
Closes #ISSUE

Adds `merge_message` field to the `UpdateRepository` proto message so
that suggested merge messages are displayed in remote projects.

Release Notes:

- git: Fixed an issue where suggested merge commit messages would not
appear for remote projects
2025-08-18 21:08:20 -05:00
Danilo Leal
6ee06bf2a0
ai onboarding: Adjust the Zed Pro banner (#36452)
Release Notes:

- N/A
2025-08-19 00:53:05 +00:00
Danilo Leal
b7edc89a87
agent: Improve error and warnings display (#36425)
This PR refactors the callout component and improves how we display
errors and warnings in the agent panel, along with improvements for
specific cases (e.g., you have `zed.dev` as your LLM provider and is
signed out).

Still a work in progress, though, wrapping up some details.

Release Notes:

- N/A
2025-08-18 21:44:07 -03:00
Agus Zubiaga
b578031120
claude: Respect always allow setting (#36450)
Claude will now respect the `agent.always_allow_tool_actions` setting
and will set it when "Always Allow" is clicked.

Release Notes:

- N/A
2025-08-18 23:27:08 +00:00
Marshall Bowers
33fbe53d48
client: Make Client::sign_in_with_optional_connect a no-op when already connected to Collab (#36449)
This PR makes it so `Client::sign_in_with_optional_connect` does nothing
when the user is already connected to Collab.

This fixes the issue where clicking on a channel link would temporarily
disconnect you from Collab.

Release Notes:

- N/A
2025-08-18 23:16:28 +00:00
Kirill Bulatov
567ceffd42
Remove an unused struct (#36448)
Release Notes:

- N/A
2025-08-18 22:54:37 +00:00
Marshall Bowers
3648dbe939
terminal: Temporarily disable test_basic_terminal test (#36447)
This PR temporarily disables the `test_basic_terminal` test, as it
flakes on macOS.

Release Notes:

- N/A
2025-08-18 22:09:30 +00:00
tidely
e7b7c206a0
terminal: Fix python venv path when spawning tasks on windows (#35909)
I haven't found any issues related to this, but it seems like currently
the wrong directory is added to the path when spawning tasks on windows
with a python virtual environment. I also deduplicated the logic at a
few places. The same constant exists in the languages crate, but we
don't want to pull an additional dependency just for this.

-1 papercut

Release Notes:

- Fix python venv path when spawning tasks on windows
2025-08-19 00:03:16 +02:00
Gregor
bb640c6a1c
Add multi selection support to UnwrapSyntaxNode (#35991)
Closes #35932
Closes #35933

I only intended to fix multi select in this, I accidentally drive-by
fixed the VIM issue as well. `replace_text_in_range` which I was using
before has two, to me unexpected, side-effects:
- it no-ops when input is disabled, which is the case in VIM's
Insert/Visual modes
- it takes the current selection into account, and does not just operate
on the given range (which I erroneously assumed before)

Now the code is using `buffer.edit` instead, which seems more lower
level, and does not have those side-effects. I was enthused to see that
it accepts a vec of edits, so I didn't have to calculate offsets for
following edits... until I also wanted to set selections, where I do
need to do it by hand. I'm still wondering if there is a simpler way to
do it, but for now it at least passes my muster

Release Notes:

- Added multiple selection support to UnwrapSyntaxNode action
- Fixed UnwrapSyntaxNode not working in VIM Insert/Visual modes
2025-08-19 01:01:46 +03:00
Piotr Osiewicz
9e0e233319
Fix clippy::needless_borrow lint violations (#36444)
Release Notes:

- N/A
2025-08-18 21:54:35 +00:00
tidely
eecf142f06
Explicitly allow clippy::new_without_default style lint (#36434)
Discussed in #36432

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-08-18 21:49:22 +00:00
localcc
97f784dedf
Fix early dispatch crash on windows (#36445)
Closes #36384

Release Notes:

- N/A
2025-08-18 21:30:02 +00:00
Smit Barmase
c5991e74bb
project: Handle textDocument/didSave and textDocument/didChange (un)registration and usage correctly (#36441)
Follow-up of https://github.com/zed-industries/zed/pull/35306

This PR contains two changes:

Both changes are inspired from:
d90a87f955/client/src/common/textSynchronization.ts

1. Handling `textDocument/didSave` and `textDocument/didChange`
registration and unregistration correctly:

```rs
#[derive(Debug, Eq, PartialEq, Clone, Deserialize, Serialize)]
#[serde(untagged)]
pub enum TextDocumentSyncCapability {
    Kind(TextDocumentSyncKind),
    Options(TextDocumentSyncOptions),
}
```

- `textDocument/didSave` dynamic registration contains "includeText"
- `textDocument/didChange` dynamic registration contains "syncKind"

While storing this to Language Server, we use
`TextDocumentSyncCapability::Options` instead of
`TextDocumentSyncCapability::Kind` since it also include
[change](be7336e92a/src/lib.rs (L1714-L1717))
field as `TextDocumentSyncCapability::Kind` as well as
[save](be7336e92a/src/lib.rs (L1727-L1729))
field as `TextDocumentSyncSaveOptions`. This way while registering or
unregistering both of them, we don't accidentaly mess with other data.

So, if at intialization we end up getting
`TextDocumentSyncCapability::Kind` and we receive any above kind of
dynamic registration, we change `TextDocumentSyncCapability::Kind` to
`TextDocumentSyncCapability::Options` so we can store more data anyway.

2. Modify `include_text` method to only depend on
`TextDocumentSyncSaveOptions`, instead of depending on
`TextDocumentSyncKind`. Idea behind this is,
`TextDocumentSyncSaveOptions` should be responsible for
"textDocument/didSave" notification, and `TextDocumentSyncKind` should
be responsible for "textDocument/didChange", which it already is:
4b79eade1d/crates/project/src/lsp_store.rs (L7324-L7331)

Release Notes:

- N/A
2025-08-19 02:27:40 +05:30
Agus Zubiaga
8b89ea1a80
Handle auth for claude (#36442)
We'll now use the anthropic provider to get credentials for `claude` and
embed its configuration view in the panel when they are not present.

Release Notes:

- N/A
2025-08-18 20:40:59 +00:00
Marshall Bowers
50819a9d20
client: Parse auth callback query parameters before showing sign-in success page (#36440)
This PR fixes an issue where we would redirect the user's browser to the
sign-in success page even if the OAuth callback was malformed.

We now parse the OAuth callback parameters from the query string and
only redirect to the sign-in success page when they are valid.

Release Notes:

- Updated the sign-in flow to not show the sign-in success page
prematurely.
2025-08-18 19:57:28 +00:00
Anthony Eid
3a3df5c011
gpui: Add support for custom prompt text in PathPromptOptions (#36410)
This will be used to improve the clarity of the git clone UI

### MacOS
<img width="1322" height="128" alt="image"
src="https://github.com/user-attachments/assets/3e511143-12c1-4440-89dd-841b21b2e98e"
/>

### Windows 
<img width="338" height="80" alt="image"
src="https://github.com/user-attachments/assets/766d08d6-0c72-4175-ad24-59dc6188d5f1"
/>

### Linux

<img width="387" height="72" alt="Screenshot From 2025-08-18 15-32-06"
src="https://github.com/user-attachments/assets/3125a7c4-3975-462a-a547-d5d4fac48f22"
/>



Release Notes:

- N/A
2025-08-18 19:48:02 +00:00
Marshall Bowers
fa61c3e24d
gpui: Fix typo in handle_gpui_events (#36431)
This PR fixes a typo I noticed in the `handle_gpui_events` method name.

Release Notes:

- N/A
2025-08-18 17:27:23 +00:00
Lukas Wirth
ed155ceba9
title_bar: Fix screensharing errors not being shown to the user (#36424)
Release Notes:

- N/A
2025-08-18 16:27:26 +00:00
tidely
e1d8e3bf6d
language: Clean up allocations (#36418)
- Correctly pre-allocate `Vec` when deserializing regexes
- Simplify manual `Vec::with_capacity` calls by using `Iterator::unzip`
- Collect directly into `Arc<[T]>` (uses `Vec` internally anyway, but
simplifies code)
- Remove unnecessary `LazyLock` around Atomics by not using const
incompatible `Default` for initialization.

Release Notes:

- N/A
2025-08-18 18:58:12 +03:00
Lucas Vieira
768b2de368
vim: Fix ap text object selection when there is line wrapping (#35485)
In Vim mode, `ap` text object (used in `vap`, `dap`, `cap`) was
selecting multiple paragraphs when soft wrap was enabled. The bug was
caused by using DisplayRow coordinates for arithmetic instead of buffer
row coordinates in the paragraph boundary calculation.

Fix by converting to buffer coordinates before arithmetic, then back to
display coordinates for the final result.

Closes #35085

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-08-18 09:57:53 -06:00
AidanV
e1d31cfcc3
vim: Display invisibles in mode indicator (#35760)
Release Notes:

- Fixes bug where `ctrl-k enter` while in `INSERT` mode would put a
newline in the Vim mode indicator


#### Old
<img width="729" height="486" alt="OldVimModeIndicator"
src="https://github.com/user-attachments/assets/58742745-5a58-4e7b-a1ef-29aa3ff1c4f7"
/>

#### New
<img width="729" height="486" alt="NewVimModeIndicator"
src="https://github.com/user-attachments/assets/e636359a-06b6-4cdd-9e62-5dc52c6f068f"
/>
2025-08-18 09:52:25 -06:00
Agus Zubiaga
48fed866e6
acp: Have AcpThread handle all interrupting (#36417)
The view was cancelling the generation, but `AcpThread` already handles
that, so we removed that extra code and fixed a bug where an update from
the first user message would appear after the second one.

Release Notes:

- N/A

Co-authored-by: Danilo <danilo@zed.dev>
2025-08-18 12:34:27 -03:00
Piotr Osiewicz
9b78c46902
python: Use pip provided by our 'base' venv (#36414)
Closes #36218

Release Notes:

- Debugger: Python debugger installation no longer assumes that pip is
available in global Python installation
2025-08-18 14:48:38 +00:00
Agus Zubiaga
db31fa67f3
acp: Stay in edit mode when current completion ends (#36413)
When a turn ends and the checkpoint is updated, `AcpThread` emits
`EntryUpdated` with the index of the user message. This was causing the
message editor to be recreated and, therefore, lose focus.

Release Notes:

- N/A
2025-08-18 11:37:28 -03:00
Danilo Leal
6bf666958c
agent2: Allow to interrupt and send a new message (#36185)
Release Notes:

- N/A
2025-08-18 10:49:17 -03:00
Umesh Yadav
6f56ac50fe
Use upstream version of yawc (#36412)
As this was merged in upstream:
https://github.com/infinitefield/yawc/pull/16. It's safe to point yawc
to upstream instead of fork. cc @maxdeviant

Release Notes:

- N/A
2025-08-18 09:15:52 -04:00
Agus Zubiaga
e2db434920
acp thread view: Floating editing message controls (#36283)
Prevents layout shift when focusing the editor

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-08-18 12:50:29 +00:00
Finn Evers
58f7006898
editor: Add tests to ensure no horizontal scrolling is possible in soft wrap mode (#36411)
Prior to https://github.com/zed-industries/zed/pull/34564 as well as
https://github.com/zed-industries/zed/pull/26893, we would have cases
where editors would be scrollable even if `soft_wrap` was set to
`editor_width`. This has regressed and improved quite a few times back
and forth. The issue was only within the editor code, the code for the
wrap map was functioning and tested properly.

Hence, this PR adds two tests to the editor rendering code in an effort
to ensure that we maintain the current correct behavior.

Release Notes:

- N/A
2025-08-18 12:35:54 +00:00
Finn Evers
1add1d042d
Add option to disable auto indentation (#36259)
Closes https://github.com/zed-industries/zed/issues/11780

While auto indentation is generally nice to have, there are cases where
it is currently just not good enough for some languages (e.g. Haskell)
or users just straight up do not want their editor to auto indent for
them. Hence, this PR adds the possibilty to disable auto indentation for
either all language or on a per-language basis. Manual invocation via
the `editor: auto indent` action will continue to work.

Also takes a similar approach as
https://github.com/zed-industries/zed/pull/31569 to ensure performance
is fine for larger multicursor edits.

Release Notes:

- Added the possibility to configure auto indentation for all languages
and per language. Add `"auto_indent": false"` to your settings or
desired language to disable the feature.
2025-08-18 14:21:33 +02:00