Commit graph

20754 commits

Author SHA1 Message Date
Elvis Pranskevichus
ac5a2b2122
python: Add recognition of worktree -> venv links (#26759)
Python envs created with virtualenvwrapper have the ability to link to
the project directory (via the `.project` file in the virtualenv).
`python-environment-tools` supports this and reports the project path.

Additionally, some tools (e.g virtualfish) recognize special
"environment activation" files in project directories (`.venv` by
default)
[1].

Use the above information to sort reported Python toolchains so that the
correct env for a given worktree is at the top.

[1]
https://virtualfish.readthedocs.io/en/latest/plugins.html#auto-activation-auto-activation

Release Notes:

- python: Improved detection of virtualenvwrapper environments in work
trees
2025-04-01 19:12:16 +02:00
Max Brunsfeld
ada8b0f822
Show commit author, not committer (#27856)
Release Notes:

- Fixed a bug where the git panel displayed a commit's committer in
place of its author.
2025-04-01 09:55:56 -07:00
Antonio Scandurra
76871056f5
Preserve cursor position when resetting excerpts (#27850)
Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-04-01 16:55:10 +00:00
Marshall Bowers
f859b328f0
assistant2: Use "Agent Panel" nomenclature for panel tooltip (#27858)
This PR updates the Agent Panel tooltip in the status to use "Agent
Panel" instead of "Assistant Panel".

Also changes the name we use in workspace serialization.

Release Notes:

- N/A
2025-04-01 16:54:40 +00:00
Marshall Bowers
e63df58adc
assistant2: Rename key context to AgentPanel (#27859)
This PR renames the key context for the Agent Panel from
"AssistantPanel2" to "AgentPanel".

Release Notes:

- N/A
2025-04-01 16:42:31 +00:00
Marshall Bowers
0ad4656489
assistant_settings: Show JSON schema for profile settings (#27855)
This PR makes it so we include the `default_profile` and `profiles`
settings in the JSON schema.

This provides completions when editing the `settings.json`.

Release Notes:

- N/A
2025-04-01 16:34:48 +00:00
Piotr Osiewicz
992831ceb6
workspace: Do not call set_active when deserializing a dock if that dock was not visible (#27852)
This unblocks work on new debugger UI, where we don't want the
set_active function to be called unconditionally.

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2025-04-01 16:33:52 +00:00
Bennet Bo Fenner
feb1d37798
assistant2: Allow clicking on @mentions (#27846)
https://github.com/user-attachments/assets/f6f7c115-5c40-48f9-a099-2b691993967b

Release Notes:

- N/A
2025-04-01 15:44:20 +00:00
Marshall Bowers
12037dc2c6
assistant2: Allow profiles to enable all context servers (#27847)
This PR adds a new `enable_all_context_servers` field to agent profiles
to allow them to enable all context servers without having to opt into
them individually.

The "Write" profile will now have all context servers enabled out of the
box.

Release Notes:

- N/A
2025-04-01 15:25:23 +00:00
Danilo Leal
ab31eb5d51
edit prediction: Show display mode options just for Zed (#27844)
Eager and Subtle modes are only supported for Zed as an edit prediction
provider and they were visible if your provider is Copilot, which is
misleading.

Release Notes:

- N/A
2025-04-01 11:07:24 -03:00
Danilo Leal
7d67bd480b
assistant2: Remove check icon from successful tool calls (#27840)
Just to streamline the UI more.

Release Notes:

- N/A
2025-04-01 10:02:21 -03:00
Stanislav Alekseev
0079771e34
Use symmetric padding in signature popovers (#27734)
Release Notes:

- Fixed padding issue with the signature popovers

------

Before:
<img width="372" alt="Screenshot 2025-03-29 at 20 30 39"
src="https://github.com/user-attachments/assets/36d1555d-bccb-4fca-b6ad-514cf11d024f"
/>

After:
<img width="375" alt="Screenshot 2025-03-29 at 20 31 13"
src="https://github.com/user-attachments/assets/6566d0e9-9dae-47dc-bfa0-526bf35f3cf0"
/>
2025-04-01 14:14:33 +02:00
Bennet Bo Fenner
d1db6d6782
assistant2: Fix issue with included directories in context picker (#27833)
Release Notes:

- N/A
2025-04-01 09:44:06 +00:00
Bennet Bo Fenner
5509e0141a
Return language model events when using Google model via zed.dev (#27831)
Release Notes:

- N/A
2025-04-01 08:58:17 +00:00
Smit Barmase
8be5ed22f6
workspace: Fix SSH remote restore on second open + Fix panel not opening automatically on new SSH remote (#27830)
Closes #26902

- We used to serialize SSH remote only when opened via recent entries,
and not on first time. This broke restore, when opening same folder for
second time from recent entries. Once opened for second time, restoring
used to. work correctly. This PR fixes this by serializing when opened
for first time.

- We didn't handle window replace post worktree creation in first time
flow, this resulted in project panel not opening automatically like it
does with recent entries, or local projects. This PR fixes it by
following same flow as recent entries.

Release Notes:

- Fixed SSH remote not restoring when opening for second time.
- Fixed project panel not opening when opening new SSH remote folder.
2025-04-01 14:05:28 +05:30
Michael Sloan
5343f1cdaf
Undo a refactor of buffer_path_log_err (#27828)
Accidentally included this in #27822

Release Notes:

- N/A
2025-04-01 07:43:40 +00:00
Anthony Eid
8075c2458f
Debugger: Fix breakpoint serialization (#27825)
This PR fixes two bugs that cause unexpected behavior with breakpoints.

The first bug made it impossible to delete the last breakpoint in a file
in the workspace's database. This caused deleted breakpoints to remain
in the database and added to new projects.

The second bug was an edge case in the breakpoint context menu where
disabling/enabling a breakpoint would sometimes set a new breakpoint on
top of the old breakpoint.


Release Notes:

- N/A
2025-04-01 05:40:05 +00:00
Michael Sloan
d0276e6666
Remove assistant ContextSnapshot (#27822)
Motivation for this is to simplify the context types and make it cleaner
to add image context.

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2025-03-31 21:57:09 -06:00
Agus Zubiaga
c729842804
assistant2: Exclude deleted files from stale list (#27821)
Release Notes:

- N/A
2025-04-01 03:26:29 +00:00
Agus Zubiaga
715e23a491
assistant2: Do not mention diagnostics until done (#27820)
Release Notes:

- N/A
2025-04-01 00:12:04 -03:00
Anthony Eid
63f0fda350
Fix code actions tooltip overlapping with action context menu (#27809)
Closes #27728

This stops code actions tooltip from being added when there's a visible
Editor::context_menu

Release Notes:

- Fix code actions tooltip opening on top of code actions menu
2025-03-31 21:56:03 -04:00
5brian
7984f0f11c
vim: Update :set (#27805)
Update VimSet commands to better match the other commands by displaying
the leading `:`:

|Before|After|
|--|--|

|![image](https://github.com/user-attachments/assets/1bc21a06-e71f-4e40-90a7-ffdd903fd7b5)|![image](https://github.com/user-attachments/assets/df59279f-d454-4701-8330-2529506850cd)|


Release Notes:

- N/A
2025-03-31 19:00:11 -06:00
Conrad Irwin
37ebb47238
Don't use dbg! in test input (#27811)
It confuses me when I grep for dbg! 🤦

Release Notes:

- N/A
2025-03-31 18:59:52 -06:00
Max Brunsfeld
8546dc101d
Allow viewing past commits in Zed (#27636)
This PR adds functionality for loading the diff for an arbitrary git
commit, and displaying it in a tab. To retrieve the diff for the commit,
I'm using a single `git cat-file --batch` invocation to efficiently load
both the old and new versions of each file that was changed in the
commit.

Todo

* Features
* [x] Open the commit view when clicking the most recent commit message
in the commit panel
  * [x] Open the commit view when clicking a SHA in a git blame column
  * [x] Open the commit view when clicking a SHA in a commit tooltip
  * [x] Make it work over RPC
  * [x] Allow buffer search in commit view
* [x] Command palette action to open the commit for the current blame
line
* Styling
* [x] Add a header that shows the author, timestamp, and the full commit
message
  * [x] Remove stage/unstage buttons in commit view
  * [x] Truncate the commit message in the tab
* Bugs
  * [x] Dedup commit tabs within a pane
  * [x] Add a tooltip to the tab

Release Notes:

- Added the ability to show past commits in Zed. You can view the most
recent commit by clicking its message in the commit panel. And when
viewing a git blame, you can show any commit by clicking its sha.
2025-03-31 23:26:47 +00:00
Danilo Leal
33912011b7
assistant2: Adjust icons for some tools (#27814)
Picking more specific icons for a few tools.

Release Notes:

- N/A
2025-03-31 20:12:51 -03:00
Danilo Leal
dce824f095
assistant2: Refine empty states design (#27812)
| No LLM provider | Fresh Start | No ToS |
|--------|--------|--------|
| ![CleanShot 2025-03-31 at 7  04
17@2x](https://github.com/user-attachments/assets/aab5987c-1530-401d-acc6-65e4f2fc13b8)
| ![CleanShot 2025-03-31 at 7  04
39@2x](https://github.com/user-attachments/assets/b2c7a2e0-5178-4bcb-a917-da7bf8e6246c)
| ![CleanShot 2025-03-31 at 7  05
10@2x](https://github.com/user-attachments/assets/4a656e82-0e1d-4d11-8d34-8eeeadd4814c)
|

Release Notes:

- N/A
2025-03-31 19:31:56 -03:00
Ben Kunkle
a1bef28da3
keymap: Allow upper-case keys in keybinds (#27813)
Reverts the error behavior introduced in #27558. Upper-case keys in
keybindings no longer generate errors, instead they are transformed into
`shift-{KEY}`
e.g. `ctrl-N` becomes `ctrl-shift-n`

The behavior introduced in #27558 where "special" keys such as function
keys, `control`, `shift`, etc. Are parsed case-insensitively is
preserved.

Release Notes:
- Improved how upper-case characters are handled in keybinds. "special"
keys such as the function keys, `control`, `shift`, etc. are now parsed
case-insensitively, so for example `F8`, `CTRL`, `SHIFT` are now
acceptable alternatives to `f8`, `ctrl`, and `shift` when declaring
keybindings. Additionally, upper-case (ascii) characters will now be
converted explicitly to `shift` + the lowercase version of the
character, to match the Vim behavior.
NOTE: Release notes above should replace the release notes from #27558
2025-03-31 22:31:01 +00:00
Marshall Bowers
8a212be0b1
assistant2: Extract method for adding a new profile to the settings (#27810)
This PR extracts a method for adding a new profile to the settings to
reduce the amount of code required inline.

Release Notes:

- N/A
2025-03-31 22:06:35 +00:00
Agus Zubiaga
76c46c5bab
assistant2: Correctly display context files outside project worktrees (#27806)
We were displaying empty pills for files that weren't inside one of the
project worktrees

Release Notes:

- N/A
2025-03-31 20:32:24 +00:00
Smit Barmase
8f0bacddd8
vim: Hide mouse cursor on type (#27804)
Closes #27639 

Release Notes:

- Fixed the mouse cursor not hiding while typing in Vim mode.

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-04-01 01:27:39 +05:30
5brian
051483200d
vim: Add :ls, :buffers (#27797)
https://neovim.io/doc/user/windows.html#%3Abuffers

Not exactly the same, but i think the zed equivalent would be the tab
switcher

Release Notes:

- vim: Added `:ls` and `:buffers`
2025-03-31 13:20:41 -06:00
5brian
27cafe5567
vim: Add :options, :map (#27798)
Add:
- [:options](https://neovim.io/doc/user/options.html#%3Aoptions) to open
default settings
- :map to open default vim keymap

These aren't exactly the same as vim but i think it's a good equivalent

For map:
I can't find the docs for :map with no arguments, since the map docs
only shows the command bindings, but it opens the key mapping in vim.

https://neovim.io/doc/user/vimindex.html

![image](https://github.com/user-attachments/assets/83aeebc4-e2e9-4818-890d-d307d5cee9b1)

Release Notes:

- vim: Added `:options` and `:map`
2025-03-31 13:19:55 -06:00
Marshall Bowers
ddc102c7e0
assistant_settings: Disable "Suggest Edits" in the assistant2 feature flag (#27802)
This PR disables the "Suggest Edits" feature when in the `assistant2`
feature flag.

This functionality has been superseded by the new Agent Panel.

We can remove the feature outright once the Agent Panel is generally
available.

Release Notes:

- N/A
2025-03-31 19:13:09 +00:00
Anthony Eid
d517a212dc
Debugger: Add conditional and hit conditional breakpoint functionality (#27760)
This PR adds conditional and hit condition breakpoint functionality 

cc @osiewicz 

Co-authored-by: Remco Smits: <djsmits12@gmail.com>

Release Notes:

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

---------

Co-authored-by: Remco Smits <djsmits12@gmail.com>
2025-03-31 19:12:23 +00:00
Piotr Osiewicz
dc64ec9cc8
chore: Bump Rust edition to 2024 (#27800)
Follow-up to https://github.com/zed-industries/zed/pull/27791

Release Notes:

- N/A
2025-03-31 20:55:27 +02:00
Danilo Leal
d50905e000
assistant2: Add testing environment variables (#27789)
To make it easier to design UIs for some of these scenarios. This PR
adds specifically two variables:
- `ZED_SIMULATE_NO_THREAD_HISTORY`
- `ZED_SIMULATE_NO_LLM_PROVIDER`

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-03-31 15:19:42 -03:00
Piotr Osiewicz
0729d24d77
chore: Prepare for Rust edition bump to 2024 (without autofix) (#27791)
Successor to #27779 - in this PR I've applied changes manually, without
futzing with if let lifetimes at all.

Release Notes:

- N/A
2025-03-31 20:10:36 +02:00
Agus Zubiaga
d51aa2ffb0
assistant find-replace: Fall back to replace_with_flexible_indent (#27795)
Release Notes:

- N/A
2025-03-31 17:51:43 +00:00
Agus Zubiaga
d40b49ceb9
Remove edit action markers from edit_prompt.md (#27785)
https://github.com/zed-industries/zed/pull/27778 removed most
occurrences, but there were still some more in `edit_prompt.md`

Release Notes:

- N/A
2025-03-31 17:49:40 +00:00
Piotr Osiewicz
edf712d45b
toolchains: Add support for relative paths (#27777)
Closes #ISSUE

Release Notes:

- N/A
2025-03-31 19:48:09 +02:00
Mikayla Maki
627ae7af6f
Remove blade as the default for GPUI (#27794)
Release Notes:

- N/A
2025-03-31 17:34:47 +00:00
5brian
17aecfde6f
vim: Fix :ex, :exit (#27755)
`:exit` should be `:exi[t]` instead of `:ex[it]`, `:ex` has different
command

- https://neovim.io/doc/user/editing.html#%3Aex
- https://neovim.io/doc/user/editing.html#%3Aexit

Changes:
- Add `:ex` same as `:edit`
- Change `:ex[it]` to `:exi[t]`

Release Notes:

- N/A
2025-03-31 11:25:11 -06:00
Bennet Bo Fenner
01a2c8eb01
Set tool schema format for zed.dev language model (#27788)
Release Notes:

- N/A
2025-03-31 16:49:59 +00:00
Conrad Irwin
fc269dfaf9
vim: Handle exclusive-linewise edgecase correctly (#27786)
Before this change we didn't explicitly handle vim's exclusive-linewise
edgecase
(https://neovim.io/doc/user/motion.html#exclusive).

Instead we had hard-coded workarounds in a few places to make our tests
pass.
The most pernicious of these workarounds was that we represented a
visual line
selection as including the trailing newline (or leading newline for
files that
end with no newline), which other code had to undo to get back to what
the user
indended.

Closes #21440
Updates #6900

Release Notes:

- vim: Fixed `d]}` to not delete the closing brace
- vim: Fixed `d}` from the start of the line to not delete the paragraph
separator
- vim: Fixed `d}` from the middle of the line to not delete the final
newline
2025-03-31 10:36:20 -06:00
Kirill Bulatov
e1e8c1786e
Fix remote clients unable to query custom, lsp_ext, commands (#27775)
Closes https://github.com/zed-industries/zed/issues/20583
Closes https://github.com/zed-industries/zed/issues/27133

A preparation for rust-analyzer's LSP tasks fetching, ensures all remote
clients are able to query custom, lsp_ext, commands.

Release Notes:

- Fixed remote clients unable to query custom, lsp_ext, commands
2025-03-31 16:13:09 +00:00
Bennet Bo Fenner
c8a9a74e6a
Add tool calling support for Gemini models (#27772)
Release Notes:

- N/A
2025-03-31 17:46:42 +02:00
Finn Evers
f6d58f76e4
ui: Render keybinds for disabled actions with disabled color (#27693)
This PR ensures that keybinds for disabled actions in context menus are
also colored according th their disabled state.

### Default

| Current `main` | This PR | 
| --- | --- | 
| <img width="212" alt="main_default"
src="https://github.com/user-attachments/assets/c9f24f4b-dff1-4930-9a3c-07ce1fad516a"
/> | <img width="212" alt="pr_default"
src="https://github.com/user-attachments/assets/fd3db1b8-3a46-4b17-81e7-de66b35b4a79"
/> |

### Vim-Mode

| Current `main` | This PR | 
| --- | --- | 
| <img width="255" alt="main_vim"
src="https://github.com/user-attachments/assets/2845efd3-0109-4e00-af92-203a328d6282"
/> | <img width="255" alt="pr_vim"
src="https://github.com/user-attachments/assets/af073173-30c0-4a60-942f-0f124089c723"
/>|


Release Notes:

- Keybinds in contexts menus will now also be dimmed if the
corresponding action is currently disabled.
2025-03-31 10:51:17 -04:00
Agus Zubiaga
e6c64ebf7e
assistant2: Fail find-replace tool if both strings are equal (#27783)
Models seem to do this ever so often and get very confused. Failing here
helps them recover.

Release Notes:

- N/A

Co-authored-by: Richard Feldman <richard@zed.dev>
2025-03-31 14:23:46 +00:00
Agus Zubiaga
ca6be249dc
assistant2: Change system prompt to discourage doom loops (#27781)
Ask assistant to limit diagnostic fix attempts to 3 max

Release Notes:

- N/A

Co-authored-by: Richard Feldman <richard@zed.dev>
2025-03-31 14:03:47 +00:00
Agus Zubiaga
9b44bacc28
Remove edit action markers literals from source (#27778)
Edit action markers look like git conflicts and can trip up tooling used
to resolve git conflicts. This PR creates them programmatically so that
they don't appear in source code.

Release Notes:

- N/A
2025-03-31 10:48:35 -03:00