Commit graph

19799 commits

Author SHA1 Message Date
Piotr Osiewicz
b15aa5e018
rust: Fix test/doctest tasks showing up outside of tests (#25787)
Closes #ISSUE

Release Notes:

- Fixes Rust test tasks showing up outside of tests
2025-02-28 00:48:19 +01:00
Cole Miller
62fb555e18
Use "restore" more consistently in the git panel (#25780)
This PR replaces almost all uses of "discard" in the git panel UI with
"restore", since that's the verb we settled on for the project diff.

The only exception is in the confirmation prompt for restoring files,
where I've kept the "discard changes" language. I think consistency is
less important here and it's helpful to rephrase the action that's being
taken to emphasize that it's destructive.

Release Notes:

- N/A
2025-02-27 18:45:56 -05:00
FalkWoldmann
c0ecf8684e
Remove once_cell dependency (#25769)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-27 23:34:37 +00:00
Kirill Bulatov
df7beb4217
Use active worktree's task sources (#25784)
Follow-up of https://github.com/zed-industries/zed/pull/25605

Previous PR made global tasks with `ZED_WORKTREE_ROOT` available for
"nothing open" scenario, this PR also gets all related worktree task
templates, using the centralized `TextContexts`' active worktree
detection.

Release Notes:

- N/A
2025-02-27 22:57:59 +00:00
Devzeth
c47305dd7b
title_bar: Fix the order of the collab buttons (#25775)
My previous #24761 and #25192 PR's changed the order of the buttons in
the title_bar for collab, the logic is kept the same but the order is
now as it was previously.

Release Notes:

- N/A

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-27 16:22:05 -05:00
Cole Miller
482a45feac
Fix broken merge (#25776)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-02-27 20:48:14 +00:00
Cole Miller
7ec3702b47
Fix cursor position when navigating to a multibuffer's first excerpt (#25723)
This PR fixes an unexpected cursor position when jumping to the
beginning of the project diff editor's first excerpt if that excerpt
starts with a deleted region. Previously, the cursor would end up in the
*following* region in this situation; now it ends up at the start of the
deleted region, as happens already for excerpts that are not the first.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2025-02-27 14:53:34 -05:00
smit
91862ddc9f
markdown_preview: Fix markdown preview not updating on AcceptEditPrediction (#25772)
Closes #25384

Markdown preview now subscribes to `ExcerptsEdited` event which is
emited when edit prediction is accepted.

Release Notes:

- Fixed markdown preview not updating when edit prediction is accepted.
2025-02-28 01:22:46 +05:30
Cole Miller
eb4fad52df
Fix panic when scrolling in project diff (#25771)
It may happen that the column for the scroll anchor is nonzero, and the
adjustment we're doing here could result in an invalid point in that
case.

Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2025-02-27 19:35:03 +00:00
Agus Zubiaga
541a5c01a4
edit predictions: Fix docs for enabled_in_assistant (#25770)
Remove mention of "prompt editor" since that feature isn't out yet.

Release Notes:

- N/A
2025-02-27 19:30:26 +00:00
Agus Zubiaga
82f793144e
edit predictions: Add enabled_in_assistant setting (#25767)
Release Notes:

- edit predictions: Add `enabled_in_assistant` setting
2025-02-27 18:52:45 +00:00
Agus Zubiaga
6eb2ffe77a
Support absolute disabled_globs (#25755)
Closes: #25556

We were always comparing `disabled_globs` against the relative file
path, we'll now use the absolute path if the glob is also absolute.

Release Notes:

- Support absolute globs in `edit_predictions.disabled_globs`
2025-02-27 15:29:32 -03:00
Mikayla Maki
c5632f8c31
Revert "Add a way to toggle inlay hints with modifiers" (#25764)
This PR caused inlay hints to show on every modifiers press

Reverts zed-industries/zed#25752

Release Notes:

- N/A
2025-02-27 10:11:36 -08:00
Cole Miller
6856e869fc
Fix git panel's suggested commit message not updating (#25708)
Closes #ISSUE

Release Notes:

- N/A
2025-02-27 12:27:09 -05:00
João Marcos
cc3b5c729e
Keep cursor at top when diff view is first opened (#25682)
Previously, we had the cursor at the bottom while the scroll stayed at
the top.

Now, if you run `git: diff`, the cursor will also be at the top.

The cursor moving to the end was possibly a side-effect of using
`Bias::Right` for selections.

---

Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-02-27 17:19:44 +00:00
Cole Miller
4e60ebab5e
Fix toggling deletion hunk with mouse at start of buffer (#25726)
Closes #ISSUE

Release Notes:

- N/A
2025-02-27 12:08:20 -05:00
Kirill Bulatov
e8ef36edcc
Add a way to toggle inlay hints with modifiers (#25752) 2025-02-27 17:53:10 +02:00
Piotr Osiewicz
2e98bc17cb
lsp: Use available workspace folders in initialize params (#25753)
Closes https://github.com/zed-industries/zed/issues/25743
Closes https://github.com/biomejs/biome-zed/issues/73

Release Notes:

- Fixed issues with launching Svelte/Biome language servers
2025-02-27 16:45:59 +01:00
Danilo Leal
5c400dac8d
assistant2: Adjust empty state layout (#25745)
Going for a different, arguably simpler design for the Assistant 2 empty
state here. Also took the opportunity to adjust other elements like the
toolbar, message editor, and some items in the configuration page.

<img
src="https://github.com/user-attachments/assets/03fd1d48-a675-4eac-b694-bbe4eeaf06e9"
width="700px"/>

Release Notes:

- N/A
2025-02-27 11:33:53 -03:00
Danilo Leal
635b80ed51
assistant2: Fix submit button width depending on certain conditions (#25748)
This PR makes the Assistant 2 submit button have a different width if
the platform is Linux or Windows, or if Vim mode is turned on. That's
because we now use written out words instead of icons for keybindings
when in those conditions.

| Before | After |
|--------|--------|
| ![CleanShot 2025-02-27 at 9  59
10@2x](https://github.com/user-attachments/assets/f1f8e27c-71c2-402c-8f7b-f9ed91e8e3bf)
| ![CleanShot 2025-02-27 at 9  56
59@2x](https://github.com/user-attachments/assets/ad13b179-daf7-4b38-83e8-1511deb97d96)
|

Release Notes:

- N/A
2025-02-27 11:33:44 -03:00
Danilo Leal
73ab5abee1
assistant2: Adjust tool call accordion visuals (#25749)
Just fine-tuning it a bit more.

<img
src="https://github.com/user-attachments/assets/0d46af77-d111-40a3-9204-d5d8aa9d4886"
width="700px"/>

Release Notes:

- N/A
2025-02-27 11:33:37 -03:00
smit
1f52aab7c7
buffer: Fix panic when multi-byte character is used in languages like Swift (#25739)
Closes #25471

In languages like Swift, names can be concatinated in form like `class
Example: UI`, notice here `Example` and `:` are two different words.
Before, `name_ranges`translation of above text would look like:

```
"class" -> [0..5]
" Example" -> [5..13] (Spaces are intentional)
"e:" -> [12..14] (This is incorrect, and should be ":" -> [13..14])
" UI" -> [14..16]
```

Because this translation does not account for concatinated words, this
might affect queries, but most importantly this panics when multi-byte
character (`ф`) is used in place of `e`, as it then tries to access
index which lies inside that multi-byte. For example, it panics on
`class Examplф: UI`.

---

This PR fixes this by handing concatinated words when calculating
`name_ranges`.

Now, the corrected ranges will look like:

```
"class" -> [0..5]
" Example" -> [5..13]
":" -> [13..14] (Now it's correct)
" UI" -> [14..16]
```

and for multi-byte character

```
"class" -> [0..5]
" Examplф" -> [5..14] (Notice ф takes two bytes)
":" -> [14..15]
" UI" -> [15..17]
```

This way, it no longer tries to access a previous index, preventing a
panic when that index contains a multi-byte character.

Release Notes:

- Fixed a panic when Cyrillic characters are used in languages like
Swift.
2025-02-27 16:27:07 +05:30
张小白
0625006a9e
windows: Missing commit of #25412 (#25732)
Closes #ISSUE

Release Notes:

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

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2025-02-27 08:00:42 +00:00
Anthony Eid
878b50c991
Update git panel entry checked box tooltip to say Stage/Unstage (#25678)
Before it would always say staged when a user hovered over the check
box. Now it will show the correct hover message depending on the state
of the entry

Release Notes:

- N/A
2025-02-27 00:29:26 -05:00
Marshall Bowers
e7df5ce61c
assistant2: Avoid unnecessary String cloning in tool use (#25725)
This PR removes some unnecessary `String` cloning in the tool use paths.

We now store the data in `Arc<str>`s for cheap cloning.

Release Notes:

- N/A
2025-02-27 03:16:09 +00:00
Marshall Bowers
da22f21dec
Move PopoverButton into ui (#25724)
This PR moves the `PopoverButton` component into the `ui` crate.

The `popover_button` crate only depended on `ui`, so there doesn't seem
to be a need for it to live in its own crate and add another step in the
crate graph.

Release Notes:

- N/A
2025-02-27 02:51:19 +00:00
Marshall Bowers
3505a17452
git_ui: Combine disjoint conditions into one (#25722)
This PR combines two disjoint conditions for the same value into one.

This makes it so the type checker can accurately reason about the
branches.

Release Notes:

- N/A
2025-02-27 02:33:25 +00:00
Marshall Bowers
81badd1fe6
Sort Cargo.tomls (#25721)
This PR sorts some `Cargo.toml`s that had become unsorted.

Release Notes:

- N/A
2025-02-27 02:28:59 +00:00
张小白
a0d1555470
windows: Fix terminal inline assistant (#25715)
Closes #18518
Closes #20546

Release Notes:

- N/A
2025-02-27 10:03:46 +08:00
Mikayla Maki
8ba7b349a5
Make the branch picker in the commit modal a popover (#25697)
Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2025-02-27 01:56:07 +00:00
Shardul Vaidya
11838cf89e
bedrock: Fix region bug (#25716)
Closes #25714

Internal team reported issue where the Bedrock provider defaulted to
"us-east-1" for all requests regardless of what is configured in the
credentials until first zed restart.

Release Notes:

- Fixed an issue where the Bedrock model provider would not always
respect the region.
2025-02-26 20:55:03 -05:00
Marshall Bowers
afc61b9527
assistant2: Automatically respond to the model with tool results (#25706)
This PR updates the tool use flow in Assistant 2 to automatically
respond to the model with tool results when the tools have finished
running.

Release Notes:

- N/A
2025-02-27 00:37:44 +00:00
张小白
672a472a23
windows: Implement cli and handle open_urls (#25412)
Closes #ISSUE

Release Notes:

- N/A
2025-02-26 16:27:19 -08:00
Marshall Bowers
9822d9673c
assistant2: Add Thread::send_to_model method (#25703)
This PR adds a new `send_to_model` method to the `Thread` to encapsulate
more of the thread-specific capabilities.

We then call this in `MessageEditor::send_to_model`.

Release Notes:

- N/A
2025-02-27 00:16:44 +00:00
Marshall Bowers
f0dec2f576
assistant2: Visualize tool use (#25692)
This PR adds visuals for tool use in Assistant 2:

<img width="1309" alt="Screenshot 2025-02-26 at 5 57 14 PM"
src="https://github.com/user-attachments/assets/4083ff65-a2f1-4a43-8815-0bade2c00af2"
/>

Release Notes:

- N/A
2025-02-26 23:19:24 +00:00
Marshall Bowers
b8fb416892
assistant2: Exclude tool uses and results when summarizing threads (#25689)
This PR fixes the generation of summaries for threads when tools are
being used.

Previously we were including the tool uses in the summarization request,
but this would result in invalid messages being sent to the model and
summaries not being generated.

We now exclude any tool uses or results from the model when summarizing
a thread.

Release Notes:

- N/A
2025-02-26 22:24:56 +00:00
Marshall Bowers
6a1c104522
language_settings: Add auto alias for subtle edit prediction mode (#25686)
This PR makes `auto` an alias for the `subtle` edit prediction mode.

Right now I'm in a state where I can't have valid settings in both
development and Nightly because the settings values are disparate.

Release Notes:

- N/A
2025-02-26 22:06:17 +00:00
Peter Tripp
b06da7f7fd
ssh: Allow ssh -F ssh_config (#25619)
- Closes https://github.com/zed-industries/zed/issues/22818

Usage: `ssh -F ssh_config user@host.tld`

```
-F configfile
    Specifies an alternative per-user configuration file. If a configuration file
    is given on the command line, the system-wide configuration file
    (/etc/ssh/ssh_config) will be ignored. The default for the per-user
    configuration file is ~/.ssh/config. If set to “none”, no configuration files
    will be read.
```

Release Notes:

- ssh: Added support for specifying ssh_config files (`ssh -F
ssh_config`) in connection string
2025-02-26 16:23:25 -05:00
Peter Tripp
f80035e0ff
Support busybox wget for downloading zed-remote-server (#25621)
- Closes: https://github.com/zed-industries/zed/issues/22380

Arch linux ships busybox wget not gnu wget.
BusyBox wget does not support `--max-redirect`.

Release Notes:

- ssh: Add support for downloading `zed-remote-server` with busybox wget (ArchLinux, etc)
2025-02-26 16:22:56 -05:00
João Marcos
be1ac78e11
Unfold buffers in multibuffers when editing them (#25677)
Release Notes:

- Multibuffers: Unfold excerpts when editing their contents.

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-02-26 17:39:33 -03:00
Kirill Bulatov
b5a1ae6526
Improve Zed tasks' ZED_WORKTREE_ROOT fallbacks (#25605)
Closes https://github.com/zed-industries/zed/issues/22912

Reworks the task context infrastructure so that it's possible to have
multiple contexts at the same time, and stores all possible worktree
context there.
Task UI code is now falling back to the "active" worktree context, if
active item's context did not produce a resolved task.

Current code does not produce meaningful results for projects with
multiple worktrees to avoid ambiguity and design changes: instead of
resolving tasks per worktree context available, extra worktree context
is only used when resolving tasks from the same worktree.

Release Notes:

- Improved Zed tasks' `ZED_WORKTREE_ROOT` fallbacks
2025-02-26 22:30:31 +02:00
Kirill Bulatov
d2b49de0e4
Dismiss active diagnostics on invalidation (#25646)
When migrating to gpui2,
588976d27a (diff-a3da3181e4ab4f73aa1697d7b6dc0caa0c17b2a187fb83b076dfc0234ec91f54R21)
removed the diagnostic style for "active but invalid" case: presumably,
it served as some sort of a cursor to show where to move on after the
diagnostics update, on the next `GoTo[Prev]Diagnostic` action call.

As this change went unchanged for some time, another approach is tested
now, to be more integrated with inline diagnostics: now, the active
state is cleared

Same as before this change, another `GoTo[Prev]Diagnostic` action call
will be needed to re-expand a new diagnostics, but this change makes
this expansion to happen after the cursor — before the change, Zed would
continue from the stale diagnostics.

Release Notes:

- Fixed active diagnostics becoming stale
2025-02-26 22:30:23 +02:00
Agus Zubiaga
d694458659
edit predictions: Rename edit prediction modes (#25657)
`auto` -> `stealth`
`eager_preview` -> `eager`

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-02-26 20:23:39 +00:00
Cole Miller
7a34dd9888
Save buffers after restoring hunks in the project diff (#25620)
This PR fixes a bug where using the project diff editor to restore hunks
from a file that's not open in its own buffer would cause those reverts
to be lost once the project diff drops its excerpts for that file.

The fix is to save the buffers after restoring them but before the
excerpts are (potentially) dropped. This is done for the project diff
editor only. If we fail to save the affected files, we add their buffers
to the active workspace, so that the reverted contents are preserved and
the user can try again to save them.

- [x] Get it working
- [x] Test
- [ ] ~~Clean up boolean soup~~

Co-authored-by: Max <max@zed.dev>

Release Notes:

- N/A
2025-02-26 15:16:17 -05:00
Michael Sloan
add7ae8052
Try to reveal selection changing issues in undo/redo via logging (#25676)
This will hopefully help debug #22692. I tried this for a while locally
and saw neither these logs nor the issue.

Release Notes:

- N/A
2025-02-26 19:48:15 +00:00
Marshall Bowers
c53020ceaf
vim: Combine match arms in Mode::is_visual (#25675)
This PR refactors the `Mode::is_visual` implementation to combine some
of the `match` arms.

Release Notes:

- N/A
2025-02-26 19:45:04 +00:00
Cole Miller
eeac1a9287
Style filenames and paths in project diff buffer headers according to git status (#25653)
This substitutes for the icons that we previously kept in these headers.

cc @iamnbutler 

Release Notes:

- N/A
2025-02-26 14:43:10 -05:00
0x2CA
e83ebd1fab
vim: Add more tests for replace with register (#25316)
Closes #ISSUE

Add more tests

Release Notes:

- N/A
2025-02-26 12:38:50 -07:00
Conrad Irwin
afb0fd609b
Chunk git status entries (#25627)
Prevents us trying to write 5M untracked files to postgres in one commit

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-02-26 12:38:16 -07:00
Conrad Irwin
b2a685f00a
Fix staging error reporting (#25630)
Closes #ISSUE

Release Notes:

- N/A
2025-02-26 12:38:04 -07:00