Commit graph

26420 commits

Author SHA1 Message Date
Agus Zubiaga
130abc8998
assistant2: Encourage diagnostics check (#27510)
Release Notes:

- N/A
2025-03-26 13:42:09 -03:00
Richard Feldman
9db4c8b710
Add Create Directory Tool (#27505)
`mkdir -p` but it works cross-platform and uses project abstractions.

<img width="629" alt="Screenshot 2025-03-26 at 11 02 37 AM"
src="https://github.com/user-attachments/assets/9ef58d53-3343-4c94-a8f3-b82ab942611b"
/>

Release Notes:

- N/A
2025-03-26 11:59:03 -04:00
Marshall Bowers
e67ad1a1b6
extension_host: Rename Extension variants so that the version number components are clearer (#27507)
This PR renames the variants of the `Extension` enum with delimiters
between the version number components so that it's clearer which version
of the extension API they refer to.

Release Notes:

- N/A
2025-03-26 15:54:14 +00:00
Alvaro Parker
82536f5243
Add support for excluding files based on .gitignore (#26636)
Closes: #17543

Release Notes:

- **New Feature:** Introduced the ability to automatically remove files
and directories from the Zed project panel that are specified in
`.gitignore`.
- **Configuration Option:** This behavior can be controlled via the new
`project_panel.hide_gitignore` setting. By setting it to `true`, files
listed in `.gitignore` will be excluded from the project panel.
- **Toggle:** Ability to toggle this setting using the action
`ProjectPanel::ToggleHideGitIgnore`

```json
  "project_panel": {
    "hide_gitignore": true
  },

```

This results in a cleaner and easier to browse project panel for
projects that generate a lot of object files like `xv6-riscv` or `linux`
without needing to tweak `file_scan_exclusions` on `settings.json`

**Preview:**
- With `"project_panel.hide_gitignore": false` (default, this is how zed
currently looks)

![Screenshot From 2025-03-23
12-50-17](https://github.com/user-attachments/assets/15607e73-a474-4188-982a-eed4e0551061)

- With `"project_panel.hide_gitignore": true` 

![Screenshot From 2025-03-23
12-50-27](https://github.com/user-attachments/assets/3e281f92-294c-4133-b5e3-25e17f15bd4d)

- Action `ProjectPanel::ToggleHideGitIgnore`

![Screenshot From 2025-03-23
12-50-55](https://github.com/user-attachments/assets/4d03db33-75ad-471c-814c-098698a8cb38)
2025-03-26 20:57:09 +05:30
Richard Feldman
9eacac62a9
Escape markdown in tools' ui_text (#27502)
Escape markdown in tools' `ui_text`

<img width="628" alt="Screenshot 2025-03-26 at 10 43 23 AM"
src="https://github.com/user-attachments/assets/bb694821-aae7-4ccf-a35a-a3317b0222d5"
/>


Release Notes:

- N/A
2025-03-26 11:27:02 -04:00
Richard Feldman
82b0881dcb
Make the "View Panel" focus the assistant panel (#27504)
Release Notes:

- N/A
2025-03-26 11:26:49 -04:00
iyht
0a49ccbebf
Allow the keybinding context to detect the terminal vi_mode (#26236)
Release Notes:

- Added support for detecting the vi_mode in the keybinding context. Now
we can define and use the keybinding when the terminal is in vi_mode.


https://github.com/user-attachments/assets/a927b6c9-c634-4739-9502-8457614d9a90
2025-03-26 20:53:23 +05:30
张小白
d232150d67
windows: Fix performance issues after trashing or deleting a folder (#27498)
Closes #25247

Since the upstream `Notify` repo hasn't merged the related PR yet, this
is basically a temporary patch to work around it.

Release Notes:

- N/A
2025-03-26 23:20:09 +08:00
Joseph T. Lyons
9a2dfa687d
Bump Zed to v0.181 (#27506)
Release Notes:

-N/A
2025-03-26 11:15:42 -04:00
Bennet Bo Fenner
1e22faebc9
lsp: Check if language server supports workspace/symbol request (#27491)
This ensures that we do not get a bunch of error logs when using the
symbol search:
```
[2025-03-26T13:23:32+01:00 ERROR project] Method not found
[2025-03-26T13:23:32+01:00 ERROR project] Method not found
[2025-03-26T13:23:32+01:00 ERROR project] Method not found
[2025-03-26T13:23:32+01:00 ERROR project] Method not found
[2025-03-26T13:23:32+01:00 ERROR project] Method not found
[2025-03-26T13:23:33+01:00 ERROR project] Method not found
...
```

Release Notes:

- N/A
2025-03-26 13:09:41 +00:00
Danilo Leal
1d9c581ae0
assistant2: Use different icons in the notification popover depending on status (#27493)
Using a check green icon for "success, you're changes are applied" and
the info, muted icon for just "there are news".

<img
src="https://github.com/user-attachments/assets/6b7e06bc-ca03-40fd-8962-7e21f5cd85d9"
width="500"/>
<img
src="https://github.com/user-attachments/assets/347ac8ac-792f-4e18-94d5-69bb9d5270e8"
width="500"/>

Release Notes:

- N/A
2025-03-26 10:03:06 -03:00
Danilo Leal
39af3b434a
assistant2: Improve tool card header scrolling affordance (#27492)
Follow up to https://github.com/zed-industries/zed/pull/27489

Added this subtle gradient to the right side of the tool card header so
users know there is more content, suggesting it can be scrolled. Also
took the opportunity to extract out commonly used custom colors in all
of these cards into their own functions to ensure consistency.

Here's the final product:


https://github.com/user-attachments/assets/e44150f9-7751-46c7-8790-149b86cc5e0f

Release Notes:

- N/A
2025-03-26 09:45:51 -03:00
Danilo Leal
64b3eea3cd
assistant2: Fix tool label overflowing on card header (#27489)
### Before

<img
src="https://github.com/user-attachments/assets/f56211d8-d60d-4e6c-9c40-af2523f71431"
width="600" />

### After

Now, you can horizontally scroll when the header holds an overflowing
label.


https://github.com/user-attachments/assets/6cb90de3-1db5-4a30-8f23-22221098a233

Release Notes:

- N/A
2025-03-26 09:10:40 -03:00
Bennet Bo Fenner
72318df4b5
lsp: Add support for textDocument/documentSymbol (#27488)
This PR adds support for retrieving the outline of a specific
buffer/document from the LSP.
E.g. for this code (`crates/cli/src/cli.rs`):
```rs
use collections::HashMap;
pub use ipc_channel::ipc;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
pub struct IpcHandshake {
    pub requests: ipc::IpcSender<CliRequest>,
    pub responses: ipc::IpcReceiver<CliResponse>,
}

#[derive(Debug, Serialize, Deserialize)]
pub enum CliRequest {
    Open {
        paths: Vec<String>,
        urls: Vec<String>,
        wait: bool,
        open_new_workspace: Option<bool>,
        env: Option<HashMap<String, String>>,
    },
}

#[derive(Debug, Serialize, Deserialize)]
pub enum CliResponse {
    Ping,
    Stdout { message: String },
    Stderr { message: String },
    Exit { status: i32 },
}

/// When Zed started not as an *.app but as a binary (e.g. local development),
/// there's a possibility to tell it to behave "regularly".
pub const FORCE_CLI_MODE_ENV_VAR_NAME: &str = "ZED_FORCE_CLI_MODE";
```

Rust-analyzer responds with:
```
Symbol: 'IpcHandshake' - Struct - (4:0-8:1) (5:11-5:23)
  Symbol: 'requests' - Field - (6:4-6:44) (6:8-6:16)
  Symbol: 'responses' - Field - (7:4-7:48) (7:8-7:17)
Symbol: 'CliRequest' - Enum - (10:0-19:1) (11:9-11:19)
  Symbol: 'Open' - EnumMember - (12:4-18:5) (12:4-12:8)
    Symbol: 'paths' - Field - (13:8-13:26) (13:8-13:13)
    Symbol: 'urls' - Field - (14:8-14:25) (14:8-14:12)
    Symbol: 'wait' - Field - (15:8-15:18) (15:8-15:12)
    Symbol: 'open_new_workspace' - Field - (16:8-16:40) (16:8-16:26)
    Symbol: 'env' - Field - (17:8-17:44) (17:8-17:11)
Symbol: 'CliResponse' - Enum - (21:0-27:1) (22:9-22:20)
  Symbol: 'Ping' - EnumMember - (23:4-23:8) (23:4-23:8)
  Symbol: 'Stdout' - EnumMember - (24:4-24:30) (24:4-24:10)
    Symbol: 'message' - Field - (24:13-24:28) (24:13-24:20)
  Symbol: 'Stderr' - EnumMember - (25:4-25:30) (25:4-25:10)
    Symbol: 'message' - Field - (25:13-25:28) (25:13-25:20)
  Symbol: 'Exit' - EnumMember - (26:4-26:24) (26:4-26:8)
    Symbol: 'status' - Field - (26:11-26:22) (26:11-26:17)
Symbol: 'FORCE_CLI_MODE_ENV_VAR_NAME' - Constant - (29:0-31:67) (31:10-31:37)
```

We'll use this to reference specific symbols in assistant2

Release Notes:

- N/A
2025-03-26 11:38:22 +00:00
Danilo Leal
d52291bac1
assistant2: Add new icons for create and delete file tool (#27487)
Release Notes:

- N/A
2025-03-26 08:20:09 -03:00
Kirill Bulatov
7462e74fbf
Improve editor::CopyAndTrim action's discoverability (#27484)
Follow-up of https://github.com/zed-industries/zed/pull/27206

Add it to the editor context menu and Zed's app menu near the `Copy`
action.

Release Notes:

- N/A
2025-03-26 10:28:32 +00:00
CharlesChen0823
de67d93a92
git: Fix staging file hunks on Windows (#26661)
Closes #26458 

I had checked, and also reference the implementation in vscode.

Release Notes:

- N/A

---------

Co-authored-by: 张小白 <364772080@qq.com>
2025-03-26 15:46:04 +08:00
Anthony Eid
a02f7e5cda
Debugger UI: Update tab content and remove red tint from terminated session (#27475)
The new tab content makes it obvious when a session is shutdown so the
red tint is no longer needed.

Release Notes:

- N/A
2025-03-26 07:13:12 +00:00
Anthony Eid
d70ac64fe4
Allow enabling/disabling breakpoints (#27280)
This PR adds the ability to enable/disable breakpoints. It also fixes a
bug where toggling a log breakpoint from the breakpoint context menu
would add a standard breakpoint on top of the log breakpoint instead of
deleting it.

todo: 
- [x] Add `BreakpointState` field Breakpoint that manages if a
breakpoint is active or not
- [x] Don't send disabled breakpoints to DAP servers - in progress
- [x] Half the opacity of disabled breakpoints - in progress
- [x] Add `BreakpointState` to database
- [x] Editor test for enabling/disabling breakpoints
- [ ] Integration Test to make sure we don't send disabled breakpoints
to DAP servers
- [x] Database test to make sure we properly serialize/deserialize
BreakpointState

Release Notes:

- N/A

---------

Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2025-03-26 02:06:08 -04:00
Michael Sloan
df583d73b9
Fix corner_radii clamping for Img when actual size is smaller than the container (#27473)
Noticed this when working on #27472

Release Notes:

- N/A
2025-03-26 05:23:27 +00:00
Michael Sloan
e091c5faaf
Fix paint_quad behavior change which clamped corner rounding (#27472)
Turns out that git deletion indicator relied on using larger-than-bounds
corner rounding - see
https://github.com/zed-industries/zed/pull/27460#issuecomment-2753174153

Release Notes:

- N/A
2025-03-26 05:09:18 +00:00
Richard Feldman
931a6d6f40
Notify when tool is finished (#27459)
Now if a tool call finishes (or is blocked on confirmation) and the Zed
window is not active, you get a notification popup. You can turn it off
with a setting.

<img width="420" alt="Screenshot 2025-03-25 at 5 19 25 PM"
src="https://github.com/user-attachments/assets/bdf7b6b8-4428-4b46-8b09-e0be140f8a51"
/>
<img width="420 alt="Screenshot 2025-03-25 at 5 18 13 PM"
src="https://github.com/user-attachments/assets/1325e7b8-cd5a-44b9-a82d-5db928ad3cfc"
/>

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-03-25 20:52:44 -04:00
Finn Evers
a605b66ce1
editor: Do not insert scrollbar hitboxes when scrollbars are disabled (#27467)
This PR fixes an issue where a clickable scrollbar track was inserted in
the editor even when scrollbars were explicitly disabled via the user's
settings. If the user has

```json
"scrollbar": {
    "show": "never"
}
```
in their settings, invisible and interactable scrollbar tracks will be
inserted in the editor if scrollbars would be required, as seen below:


https://github.com/user-attachments/assets/b0d915a9-7a7e-4518-84d8-96d9b15aab12

The bug occurs because we only set the scrollbar contents to be
invisible, which however does not affect the insertion of hitboxes for
the scrollbars.

This PR fixes this behaviour by preventing any scrollbar layouting from
happening when scrollbars are explicitly disabled via the settings:


https://github.com/user-attachments/assets/a3f5725b-aead-4fec-9fd8-e574cf269d45

All existing panels which have configurable scrollbars behave the same
way, see
fb2586a553/crates/outline_panel/src/outline_panel.rs (L4362-L4373)

for example. Following this check, neither a thumb nor a track is
inserted in any case when scrollbars are never to be shown.

Release Notes:

- Fixed invisible scrollbar tracks being inserted into the editor when
scrollbars are explicitly disabled via settings.
2025-03-26 01:44:35 +01:00
Michael Sloan
7376c6f377
Add support for Gemini 2.5 Pro Experimental model (#27468)
Release Notes:

- Added support for Gemini 2.5 Pro Experimental model to Zed AI.

Co-authored-by: Wilhelm Klopp <wil.klopp@gmail.com>
2025-03-26 00:12:10 +00:00
Smit Barmase
ee08776f34
markdown_preview: Fix code block highlight and indentation (#27463)
Closes #23218

Before:
<img width="1463" alt="before"
src="https://github.com/user-attachments/assets/4f77a4e0-61b8-4516-91a4-366f73e24760"
/>

After:
<img width="1463" alt="after"
src="https://github.com/user-attachments/assets/61e2c69d-fa6b-4c52-b1eb-ad7a61e274e0"
/>


Release Notes:

- Fixed issue where code block highlight and indentation in markdown
preview was rendered incorrectly.
2025-03-26 04:14:23 +05:30
Kirill Bulatov
30f7e896cf
Add a way to control go to definition fallback (#27426)
Follow-up of https://github.com/zed-industries/zed/pull/9243 and
https://github.com/zed-industries/zed/pull/16512

Release Notes:

- Added a way to control go to definition fallback
2025-03-25 22:13:35 +00:00
Michael Sloan
8c8f50d916
Pull logic for clamping corner rounding radii out of Corners::to_pixels (#27460)
This seems more correct as corners are not necessarily only for rounding
radii.

Also applies clamping after scaling in `paint_quad`, deduplicating that
logic. This also provides a more precise result by doing the clamping
after scaling, avoiding floating point rounding issues (probably a
non-issue).

Release Notes:

- N/A
2025-03-25 21:56:17 +00:00
Ben Kunkle
76192ea93c
worktree: Don't open files >= 6GB in size (#27458)
Temporary Workaround For: #27283

This PR can (and should!) be reverted once the underlying inefficiencies
are resolved

Release Notes:

- Files that are 6GB or larger will now not open. This is a temporary
workaround for inefficient handling of large files resulting in
extremely high memory usage, often resulting in system freezing,
requiring a restart of Zed or the entire system.
2025-03-25 16:43:40 -05:00
Danilo Leal
fb2586a553
assistant2: Add some padding top to the checkpoint element (#27456)
Most minimal PR ever.

Release Notes:

- N/A
2025-03-25 21:21:03 +00:00
Peter Tripp
28e0bb5a12
ci: Run nix nightly on any mac runners (#27457)
Nix nightly builds can now run on all macOS runners.

Follow-up to: https://github.com/zed-industries/zed/pull/27014

Release Notes:

- N/A
2025-03-25 17:15:15 -04:00
Finn Evers
a65ea2708c
editor: Refactor scrollbar-related code (#24134)
This PR is primarily an implementation of @osiewicz
[comment](https://github.com/zed-industries/zed/pull/19495#pullrequestreview-2488877957)
in an effort to increase maintainability after the horizontal editor
scrollbar was added in #19495 . I also want to build on these changes in
future PRs to adress some other small bugs.

This primarily does the following:
1. Uses `along` wherever possible
2. Fixes the amount of mouse event listeners attached to the editor when
scrollbars are displayed to 2 instead of 2-4 in case both scrollbars are
displayed.

This can be done since only one scrollbar can be dragged by the cursor
at any given time, so the event listeners now account for that. The
state reflecting the scrollbar dragging state was also updated
accordingly.

It does not change any functionality besides the aforementioned event
listener code as well as some minor bugs which where present after
#19495 , namely:
- One missing `cx.stop_propagation()` (see
[here](a8741dc310/crates/editor/src/element.rs (L4684))
and
[here](a8741dc310/crates/editor/src/element.rs (L4838))
respectively).
- The horizontal scrollbar thumb having a small border on the left side,
which seems to be unintended for the horizontal scrollbar whilst
intended for the vertical one. Since this is a minimal change, I figured
it could be already included in this PR.

This PR admittetly grew quite large over time, however, much of the diff
is just renames to account for the code now working for both axes as
well as moved code. The logic remains (or should at least be)
unaffected. If I should split this into two PRs or remove some of the
changes, please let me know.

Release Notes:

- N/A
2025-03-25 22:08:46 +01:00
Alex van de Griendt
1574a3a2fd
python: Add task for running modules (#26462)
Closes #26460

I am new to contributing to Zed (and pretty new to Rust in general). I'm
not too familiar with code style, guidelines etc. so please feel free to
suggest changes/improvements.

This PR adds a run icon to Python files that have a "main" function:
```python
if __name__ == "__main__":
    ...
```

In addition to the gutter icon, there is now also an extra task in the
command palette "run module".

Release Notes:

- Added detection for runnable Python modules
- Added Python-specific task to run a Python file as a module from
inside the project's scope

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2025-03-25 22:08:16 +01:00
Danilo Leal
152432f1d9
title bar: Adjust the onboarding banner component API (#27455)
This PR encapsulates the layout building of the Onboarding Banner
component inside of it, allowing to, at the call site, just pass an
icon, title, and subtitle. The `subtitle` parameter, by default, uses
the `Introducing:` label, which I think will be the one we'll use most
of the time for this specific component.

Release Notes:

- N/A
2025-03-25 17:57:42 -03:00
Marshall Bowers
5953c6167b
assistant2: Allow profiles to manage context server tools (#27452)
This PR updates the agent profiles with support for managing context
server tools.

Release Notes:

- N/A
2025-03-25 19:55:59 +00:00
Danilo Leal
aab02a4166
Fix color swatch shrinking in the LSP completion menu (#27450)
### Before

Note how in the second time I try to add a color property, the color
swatch is shrunk.


https://github.com/user-attachments/assets/677a37b2-8ae4-408d-8dea-d9cc4bc2e119

### After


https://github.com/user-attachments/assets/aa902573-1f44-48e1-a396-e22ad5703155

Release Notes:

- Fixed color swatches shrinking upon re-adding a color-related
property.
2025-03-25 16:55:42 -03:00
Michael Sloan
9fc570c4be
Remove Pixels: Mul<Pixels, Output = Pixels> impl, add ScaledPixels ops (#27451)
It doesn't make sense to have `Pixels: Mul<Pixels, Output = Pixels>` as
the output should be `Pixels^2` (area), so these impls are removed. All
code where these impls were used are improved by instead multiplying by
`f32` or `usize`.

Also adds math op impls that are present for `Pixels` but absent for
`ScaledPixels`. Adds missing `Mul<Pixels> for usize` to both.

Release Notes:

- N/A
2025-03-25 19:34:26 +00:00
Marshall Bowers
581d67398a
Remove ui dependency from assistant_tool and context_server (#27449)
This PR removes the dependency on the `ui` crate from the
`assistant_tool` and `context_server` crates.

These crates were only depending on it for `IconName`, which can now be
depended on from `icons` directly.

Release Notes:

- N/A
2025-03-25 18:37:15 +00:00
Marshall Bowers
4a30b960d4
language_model: Remove dependency on ui (#27448)
This PR removes the dependency on the `ui` crate from the
`language_model` crate.

We were only depending on it to import `IconName`—which now lives in
`icons`—and some re-exported GPUI items.

Release Notes:

- N/A
2025-03-25 18:30:46 +00:00
Marshall Bowers
503bf607c5
Add icons crate (#27447)
This PR adds a new `icons` crate and moves the `IconName` into it.

We have a number of crates that are taking a dependency on `ui` just so
they can talk about icons, which is not ideal.

Release Notes:

- N/A
2025-03-25 18:18:22 +00:00
Agus Zubiaga
46e86f003f
assistant tools: Add Tool::icon method instead of matching on name (#27444)
Release Notes:

- N/A
2025-03-25 18:17:36 +00:00
Marshall Bowers
0339d654d2
zed: Make inline assist quick action dispatch an action (#27445)
This PR makes the "Inline Assist" quick action in the quick action bar
work by dispatching the `InlineAssist` action.

This fixes an issue where the button was not working with Assistant 2.

Release Notes:

- N/A
2025-03-25 18:11:30 +00:00
Agus Zubiaga
24d76a64c3
Reapply #27200 after bad conflict resolution (#27446)
Release Notes:

- N/A
2025-03-25 18:06:45 +00:00
Piotr Osiewicz
3ba624391f
debugger ui: Make variable values muted by default (#27441)
Closes #ISSUE

Release Notes:

- N/A
2025-03-25 18:43:27 +01:00
Michael Sloan
31e3c13ea9
Add .github/copilot-instructions.md to paths loaded for rules (#27442)
Release Notes:

- N/A
2025-03-25 17:30:37 +00:00
Marshall Bowers
0fec04a1b7
assistant2: Disable "Add Server" button when the required fields are empty (#27440)
This PR updates the add context server modal to disable the "Add Server"
button when the required fields are not filled out.

Release Notes:

- N/A
2025-03-25 17:19:30 +00:00
Richard Feldman
bf255486c0
Add find-replace-file tool, use it by default over edit-files-tool (#27438)
@agu-z and paired on trying out a "one tool call per edit" approach for
editing files. (The previous approach is still available, it's just
unchecked by default for now.)

Release Notes:

- N/A

---------

Co-authored-by: Agus <agus@zed.dev>
2025-03-25 13:12:50 -04:00
Nathan Sobo
cd1e56d6c7
Add support for dashed borders to GPUI (#27139)
Features:

* Scales dash spacing with border width.
* Laying out dashes around rounded corners.
* Varying border widths with rounded corners - now uses an ellipse for the inner edge of the border.
* When there are no rounded corners, each straight border is laid out separately, so that the dashes to meet at the corners.
* All sides of each dash are antialiased.

![image](https://github.com/user-attachments/assets/b3789a98-a5be-4f97-9736-c4e59615afe6)

![image](https://github.com/user-attachments/assets/739bdc57-4580-42c8-bfc3-6e287411a408)

Release Notes:

- N/A

---------

Co-authored-by: Michael Sloan <michael@zed.dev>
Co-authored-by: Ben <ben@zed.dev>
2025-03-25 11:11:04 -06:00
Piotr Osiewicz
2fe2028e20
debugger: Fix typing in active buffer resulting a jump to an active debug line (#27439)
/cc @iamnbutler 

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2025-03-25 17:08:36 +00:00
Piotr Osiewicz
f9212a001e
debugger: Make UI a bit more dense (#27429)
Closes #ISSUE

Release Notes:

- N/A
2025-03-25 17:58:51 +01:00
Joseph T. Lyons
954a56ce0c
Update stale issue bot to run on Wednesday (#27437)
Release Notes:

- N/A
2025-03-25 16:40:43 +00:00