Commit log

584fa3d docs: Add Yara language extension (#28693)

Click to expand commit body
This PR adds a quick overview of the Yara language extension in order to
display the language on the Zed [site](https://zed.dev/docs/languages).

Release Notes:

- N/A

---------

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>

Evan Gibler and Marshall Bowers created

a051194 agent: Check built-in tools schema compatibility in tests (#28691)

Click to expand commit body
This ensures that we respect the `LanguageModelToolSchemaFormat` value
when we call `tool.input_schema`. This prevents us from breaking Gemini
compatibility when adding/changing built-in tools. See #28634.

The test suite will now fail with an error message like this, when
providing an incompatible input_schema:

```
thread 'tests::test_tool_schema_compatibility' panicked at crates/assistant_tools/src/assistant_tools.rs:108:17:
Tool schema for `code_actions` is not compatible with `language_model::LanguageModelToolSchemaFormat::JsonSchemaSubset` (Gemini Models).
Are you using `schema::json_schema_for<T>(format)` to generate the schema?
```


Release Notes:

- N/A

Bennet Bo Fenner created

78ecc3c git: Amend (#28187)

Click to expand commit body
Adds git amend support.

- [x] Turn existing commit button into split button
- [x] Clean up + Handle shortcuts/focus cases
- [x] Test remote

Release Notes:

- Added git amend support.

---------

Co-authored-by: Cole Miller <cole@zed.dev>

Smit Barmase and Cole Miller created

ac8a4ba agent: Add scrollbar to the history view (#28690)

Click to expand commit body
Ended up not making this one visible only upon hover or something
because the layout alignment would be weird given the list item spans
the full width. So, experimenting with this design here:

<img
src="https://github.com/user-attachments/assets/62bf661e-1aae-4644-8a89-49cefb3e8130"
width="700" />

Release Notes:

- agent: Add scrollbar to the history view.

Danilo Leal created

9863b48 project/perf: Optimize BufferStore::get_by_path with an additional index (#28670)

Click to expand commit body
Closes #27270

Release Notes:

- Improved performance of git panel with large # of untracked files

Piotr Osiewicz created

fddaa31 assistant_tools: Fix code_action and rename schemas for Gemini (#28634)

Click to expand commit body
Closes #28475

Updates `rename` and `code_action` `input_schema` methods to use
`json_schema_for<T>()` which transforms standard JSONSchema into the
subset required by Gemini.
Also makes `input_schema` implementations consistent.
Tested tools against Gemini 2.5 Pro Preview, Zed Claude 3.7 Sonnet
Thinking, o3-mini

Release Notes:

- Agent Beta: Fixed error 400 `INVALID_ARGUMENT` when using Gemini with
`code_actions` or `rename` tools enabled.

duvetfall created

b452307 agent: Handle context window exceeded errors from Anthropic (#28688)

Click to expand commit body
![CleanShot 2025-04-14 at 11 15
38@2x](https://github.com/user-attachments/assets/9e803ffb-74fd-486b-bebc-2155a407a9fa)

Release Notes:

- agent: Handle context window exceeded errors from Anthropic

Agus Zubiaga created

4a57664 zlog: Use zlog as default log implementation (#28612)

Click to expand commit body
Still TODO:

- [x] Remove old log implementations
- [x] More cleanup
- [x] Verify atomic/lock logic
- [x] More tests
- [ ] ??? Ansi coloring when logging to stdout

Release Notes:

- N/A

Ben Kunkle created

0eb0a3c agent: Move focus to the message editor after going back (#28686)

Click to expand commit body
When you hit the back button in the agent panel toolbar, we were
returning the focus to the buffer instead to the panel's message editor,
which is likely where you want to be after quickly checking history or
settings.

Release Notes:

- N/A

Danilo Leal created

6278761 agent: Fix expand message editor while not focused (#28650)

Click to expand commit body
Allow expanding the message editor while the agent panel is not focused,
right now there is no effect when you use the button from another focus

Release Notes:

- N/A

5brian created

f2ce183 editor: Show code actions in mouse context menu (#28677)

Click to expand commit body
Closes #27989

Asynchronous fetch of code actions on right-click, and shows them in
context menu.


https://github.com/user-attachments/assets/413eb0dd-cd1c-4628-a6f1-84eac813da32

Release Notes:

- Improved visibility of code actions by showing them in right-click
context menu.

Smit Barmase created

98891e4 language: Optimize language_for_file (#28671)

Click to expand commit body
While working on #28670 this function showed up in my profiles; this PR
makes it evaluate some of it's conditions lazily + prevent constant
rebuilding of globset::Candidates.

Release Notes:

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

Piotr Osiewicz created

5e57f14 nix: Bump rust-overlay for Rust 1.86 (#28181)

Click to expand commit body
otherwise nix develop doesn't work, complains about not knowing about
rust 1.86

Release Notes:

- N/A

maan2003 created

128779f docs: Improve Lua language documentation (#28662)

Click to expand commit body
Release Notes:

- N/A

Peter Tripp created

b25c333 Detect decorated pytest methods as runnable (#28652)

Click to expand commit body
Closes #28096

Release Notes:

- Fixed decorated pytest methods not being picked up as runnable

hrou0003 created

77544f4 snippets: Fix plaintext snippets not working (#28655)

Click to expand commit body
This PR fixes a minor regression introduced in #27718, where snippets
stopped working when the language was set to plaintext because
`languages_at` doesn't include plaintext, while `language_at` does.

Release Notes:

- Fixed plaintext snippets not working

loczek created

b864a9b hover_popover: Fix markdown selection for info and diagnostic popovers (#28642)

Click to expand commit body
Closes #28638

This PR fixes markdown selection for the info and diagnostic popovers.

In the editor popover, after the changes in
https://github.com/zed-industries/zed/pull/28255, the markdown selection
state updates correctly, but it no longer triggers the editor element to
repaint like it used to. This is fixed by adding a subscription to
listen for markdown entity changes and triggering a repaint for the
editor.

I assume markdown selection works elsewhere because:

1. Either the `Markdown` entity is directly part of a struct that
implements the `Render` trait, causing it to repaint whenever the
markdown state changes. See
[here](https://github.com/zed-industries/zed/blob/d1ffda9bfeccfdf9bea3f76251350bf9cf7f6e1b/crates/ui_prompt/src/ui_prompt.rs#L65).
2. OR it's wrapped around component like Popover which implements
`RenderOnce` trait. See
[here](https://github.com/zed-industries/zed/blob/d1ffda9bfeccfdf9bea3f76251350bf9cf7f6e1b/crates/editor/src/code_context_menus.rs#L645).

Whereas info and diagnostic popovers does not do both. I do think we can
change it to use `Popover` component, but for now this works as quick
fix.

Extras:
- Remove unnecessary struct cloning.
- Refactor rendering logic to use `when_some`.

Release Notes:

- Fixed issue where selection wasn't working for info and diagnostic
popovers.

Smit Barmase created

e4844b2 Keep .vscode folder included during initialization even if it's in .gitignore (#28631)

Click to expand commit body
This fixes an issue where tasks in `.vscode/tasks.json` weren't being
loaded at startup of a project

Closes #28494

Release Notes:

- Tasks are now loaded from local `.vscode/tasks.json` files even if
they are `.gitignore`d

hrou0003 created

d1ffda9 agent: Display keybindings for "Reject All" and "Keep All" (#28620)

Click to expand commit body
<img
src="https://github.com/user-attachments/assets/2cdc5121-dd7b-4f46-8d43-88d5152c77ea"
width="550" />


Release Notes:

- N/A

Danilo Leal created

8ffa584 agent: Increase message editor height (#28618)

Click to expand commit body
It was too tiny, felt like we could use more breathing room.

Release Notes:

- N/A

Danilo Leal created

fb78cbb agent: Adjust MCP section in the settings view (#28615)

Click to expand commit body
Mentioning "MCP" more prominently, adding tool descriptions in the icon
button tooltip, and other UI adjustments.

<img
src="https://github.com/user-attachments/assets/e021b3be-99b8-454c-b5fd-0221a7947a35"
width="600" />

Release Notes:

- N/A

Danilo Leal created

17719f9 agent: Add "Install MCPs" to panel menu (#28616)

Click to expand commit body
Also took the opportunity to rename the "Continue in New Thread" item to
a potentially clearer name.

<img
src="https://github.com/user-attachments/assets/024de07d-f215-4c41-8fbe-652a216b61d9"
width="300"/>

Release Notes:

- N/A

Danilo Leal created

055df30 Directly parse .git when it's a file instead of using libgit2 (#27885)

Click to expand commit body
Avoids building a whole git2 repository object at the worktree layer
just to watch some additional paths.

- [x] Tidy up names of the various paths
- [x] Tests for worktrees and submodules

Release Notes:

- N/A

Cole Miller created

429d458 agent: Cleanup `message_editor` (#28614)

Click to expand commit body
This PR splits up the rendering of the message editor into multiple
functions. Previously we had a single `h_flex()...` expression which
spanned across 550 lines, `cargo fmt` stopped working.

Release Notes:

- N/A

Bennet Bo Fenner created

62ebae9 agent: Only show recommended models that are actually configured (#28613)

Click to expand commit body
Release Notes:

- N/A

Bennet Bo Fenner created

0036a33 agent: Remove unused code (#28552)

Click to expand commit body
This code was used before we had a proper completion menu for
at-mentions

Release Notes:

- N/A

Bennet Bo Fenner created

b22faf9 agent: Refine language model selector (#28597)

Click to expand commit body
Release Notes:

- agent: Show recommended models in the agent model selector and display
the provider in the model selector's trigger.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>

Bennet Bo Fenner , Danilo Leal , and Danilo Leal created

dafe994 agent: Register tracked buffers with language servers (#28610)

Click to expand commit body
Release Notes:

- agent: Start language servers when accessing files via tools

Co-authored-by: Michael <michael@zed.dev>

Agus Zubiaga and Michael created

5994ac5 Use NoopTextSystem during tests (#28607)

Click to expand commit body
This should allow tests to be more similar across platforms.

Release Notes:

- N/A

Conrad Irwin created

97a9a5d snippets: Fix snippets for PHP and ERB languages (#27718)

Click to expand commit body
Closes #21541
Closes #22726

This should fix snippets in languages, like PHP, that are based on the
HTML syntax layer. To be honest, I don't totally get where HTML comes
into it, but the issues outlined in #21541 and #22726 both boil down to
"Zed only shows me HTML snippets in PHP/ERB files; I expected to see
PHP/ERB snippets". This solution is based on the comments between
@mrnugget and @osiewicz in #22726: resolve/combine snippets for all
language layers at the given position, whereas current behavior is to
resolve snippets only for the `.last()` language layer at the given
position.

- add `Buffer:languages_at()` (note the plural)
- update `snippet_completions()` in `editor.rs` to loop over each
language, gathering snippets as it goes
- the primary logic for resolving snippets within a single language has
not changed

### Verifying this change

I couldn't find tests related to snippet and currently active languages
(CI may show them to me 😆 ) but I can add some if desired and w/ perhaps
a little coaching or prompting about another test to look to for
inspiration. I have confirmed that this works for PHP, but I have not
checked ERB because I'm not familiar with it or set up for it.

To check this manually:
1. install the PHP extension
2. install at least 1 snippet for each of html, php and phpdoc. If you
don't have any, these should work:
```sh
# BEWARE these will clobber existing snippets!
echo '{"dddd":{"body":"hello from phpdoc"}}' > ~/.config/zed/snippets/phpdoc.json
echo '{"pppp":{"body":"hello from PHP"}}' > ~/.config/zed/snippets/php.json
echo '{"hhhh":{"body":"hello from HTML"}}' > ~/.config/zed/snippets/html.json
```
3. open any PHP file. If you don't have one, here's one that should
work:
```php
<?php

/**
 *
 */
function function_name()
{
}
```
4. Place your cursor in a PHPdoc comment (eg after the `/**` on line 3)
- you should be able to use the `dddd`, `pppp` and `hhhh` snippets; on
`main`, only the `dddd` snippet works here
5. Move your cursor to a non-comment PHP area (eg after the `{` on line
7)
- you should be able to use the `pppp` and `hhhh` snippets, but not
`dddd`; on `main`, only `hhhh` works here

### Performance

This adds 2 separate (not nested) loops to `snippet_completions()`, each
of which will iterate over the active language scopes at the given
location. I have not looked into the specifics of how many layers most
languages have, but I suspect that *most* users will see identical
performance as before because there will only be 1 scope active most of
the time.

In some cases, though (eg PHP, ERB, maybe template strings in JS), the
editor will be looping over more layers, possibly many in some deeply
injected/embedded cases (I'm thinking of a regex template string in a JS
heredoc string in a PHP script in an HTML file). I don't expect this to
be an issue – nor has it been in my usage and testing – but performance
of snippets could be affected in pathological cases.

### Alternate solutions

Instead of resolving snippets for *all* layers, we could just change how
we pick which language to resolve. Instead of always using `.last()`,
perhaps we could do something more clever. This feels like it could be
tricky and potentially error prone, though.

Release Notes:

- Snippets are now resolved for all languages active at the cursor
location.
- Fixed snippets in PHP, ERB and other languages whose syntax layers are
based on HTML

claytonrcarter created

730f2e7 vim: Add highlighting to set commands (#28600)

Click to expand commit body
|Before|After|
|--|--|

|![image](https://github.com/user-attachments/assets/fb965e1f-658c-4ecd-a51f-821881b8001a)|![image](https://github.com/user-attachments/assets/f05f73bf-6661-406a-a5d6-e121e5b6fd1a)|

Release Notes:

- N/A

5brian created

141ad72 extension: Use `heck` instead of `convert_case` for snake_case check (#28608)

Click to expand commit body
This PR updates the snake_case check for grammar names to use `heck`
instead of `convert_case`.

`heck` correctly handles values like `d2`.

Fixes https://github.com/zed-industries/zed/issues/28583.

Release Notes:

- Updated snake_case check for grammar names in extensions.

Marshall Bowers created

a5fe6d1 History manager (#26369)

Click to expand commit body
While working on implementing `add_recent_documents` for Windows, I
found that the process is significantly more complex compared to macOS.
On macOS, simply registering the `add_recent_documents` function is
enough, as the system handles everything automatically.

On Windows, however, there are two cases to consider:  
- **Files opened by the app**: These appear in the "Recent" section (as
shown in the screenshot, "test.txt") and are managed automatically by
Windows (by setting windows registry), similar to macOS.

![屏幕截图 2025-03-10
230738](https://github.com/user-attachments/assets/8fc8063b-4369-43cc-aaaf-7370a7d27060)


- **Folders opened by the app**: This is more complicated because
Windows does not handle it automatically, requiring the application to
track opened folders manually.

To address this, this PR introduces a `History Manager` along with
`HistoryManagerEvent::Update` and `HistoryManagerEvent::Delete` events
to simplify the process of managing recently opened folders.



https://github.com/user-attachments/assets/a2581c15-7653-4faf-96b0-7c48ab1dcc8d



Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>

张小白 and Mikayla Maki created

5734ffb Update haskell extension docs (#28603)

Click to expand commit body
In https://github.com/zed-extensions/haskell/pull/2 the HLS settings
were updated to respect binary path/argument overrides. This PR just
updates the docs to demonstrate this.

Release Notes:

- N/A

---------

Co-authored-by: Peter Tripp <peter@zed.dev>

Sam Tay and Peter Tripp created

932a7c6 keymap: Document editor::Select* actions (cmd-d, etc) (#28362)

Click to expand commit body
This is a no-op change which just adds comments.

Release Notes:

- N/A

Peter Tripp created

6a60bb1 ci: No draft releases when using 'run-bundling' (#28596)

Click to expand commit body
Improve the logic in around release artifact bundling.
- Suppress a harmless "error: no such command: `about`" from
script/generate-licenes output
- Remove checks for main branch (which will never be true)
- Only run `Upload Artifacts to release` when not using `run-bundling`.
Prevents the creation of draft releases with just linux remote server binaries)

Release Notes:

- N/A

Peter Tripp created

5909d12 Fix a panic in the git store (#28590)

Click to expand commit body
Closes #ISSUE

Release Notes:

- Fixed a panic that could occur when git statuses were updated.

Cole Miller created

78662f8 debugger: UI refinements (#28589)

Click to expand commit body
- Name of source is only used as a fallback if there's no path
- Make the frames a bit more compact.


![image](https://github.com/user-attachments/assets/74772455-c16e-477f-a962-dffd4575e557)

Release Notes:

- N/A

Piotr Osiewicz created

c2e3134 Try to weak-link ScreenCaptureKit always (#28585)

Click to expand commit body
Closes #ISSUE

Release Notes:

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

Conrad Irwin created

66b3e03 Fix a bug causing stale optimistic state in the git panel (#28588)

Click to expand commit body
Release Notes:

- Fixed a bug that caused the staged status of files in the git panel to
be out of date in some cases.

Cole Miller created

7caa2c2 debugger: Prompt user when they try to close a running debug session (#28584)

Click to expand commit body
Closes #ISSUE

Release Notes:

- N/A

Piotr Osiewicz created

08ce230 vim: Add some forced motion support (#27991)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/20971

Added `v` input to yank and delete to override default motion. The
global vim state tracking if the forced motion flag was passed handled
the same way that the count is. [The main chunk of code maps the motion
kind from the default to the overridden
kind](https://github.com/zed-industries/zed/pull/27991/files#diff-2dca6b7d1673c912d14e4edc74e415abbe3a4e6d6b37e0e2006d30828bf4bb9cR1249-R1254).
To handle the case of deleting a single character (dv0) at the start of
a row I had to modify the control flow
[here](https://github.com/zed-industries/zed/pull/27991/files#diff-2dca6b7d1673c912d14e4edc74e415abbe3a4e6d6b37e0e2006d30828bf4bb9cR1240-R1244).
Then to handle an exclusive delete till the end of the row (dv$) I
[saturated the endpoint with a left
bias](https://github.com/zed-industries/zed/pull/27991/files#diff-2dca6b7d1673c912d14e4edc74e415abbe3a4e6d6b37e0e2006d30828bf4bb9cR1281-R1286).

Test case: dv0


https://github.com/user-attachments/assets/613cf9fb-9732-425c-9179-025f3e107584

Test case: yvjp


https://github.com/user-attachments/assets/550b7c77-1eb8-41c3-894b-117eb50b7a5d

Release Notes:

- Added some forced motion support for delete and yank

Peter Finn created

1df01ea workspace: Implement Extended Terminal Option (#26211)

Click to expand commit body
Closes #10211 
Closes #7575 

Screenshot of feature:
![Screenshot 2025-03-06 at 1 08
13 PM](https://github.com/user-attachments/assets/73cc4519-248b-4264-9ce8-42d0980cf73c)

Screenshot of proposed menu:
![Screenshot 2025-03-06 at 1 14
30 PM](https://github.com/user-attachments/assets/efc7c18a-a2a5-491f-b3e5-5ed181f23906)

Screenshot of proposed menu closed:
![Screenshot 2025-03-06 at 1 14
57 PM](https://github.com/user-attachments/assets/0b42829c-abe3-48aa-9b81-30a0aeeac8fd)

Release Notes:

- Configuration of bottom_dock_layout in settings.json
- Layout Mode button in Title Bar
- 4 different layout modes for the bottom dock: contained (default),
full (extends below both docks), left-aligned, right-aligned (extends
only below the respective dock)

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>

Thomas Jensen and Mikayla Maki created

2f5c662 Refine component preview & add serialization (#28545)

Click to expand commit body
https://github.com/user-attachments/assets/0be12a9a-f6ce-4eca-90de-6ef01eb41ff9

- Allows the active ComponentPreview page to be restored via
serialization
- Allows filtering components using a filter input
- Updates component example rendering
- Updates some components

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

Nate Butler and Max Brunsfeld created

a03fb37 docs: Fix name for `zed: open project tasks` command (#28578)

Click to expand commit body
There's no `zed: open local tasks`, perhaps it was called that
previously.

Release Notes:

- N/A

Andy Waite created

dd7bc5f vim: Add delete keymapping to vim.json (#28551)

Click to expand commit body
Closes #16511

Added test for delete in normal mode and keymapping in vim.json

Release Notes:

- Added delete mapping in normal mode

Peter Finn created

c7d3fbc debugger: Fix Debugpy spawning & session removal (#28577)

Click to expand commit body
Closes #ISSUE

Release Notes:

- N/A

Piotr Osiewicz created

1164829 html: Bump to v0.2.1 (#28575)

Click to expand commit body
This PR bumps the HTML extension to v0.2.1.

Changes:

- https://github.com/zed-industries/zed/pull/28542

Release Notes:

- N/A

Marshall Bowers created

e09eeb7 debugger: Style debugger tabs (#28572)

Click to expand commit body
![image](https://github.com/user-attachments/assets/a88b1897-cb96-4c6c-b602-396a91ef4de8)

Release Notes:

- N/A

Piotr Osiewicz created

cdcad70 task: Poll Rust subcommands on background thread (#28553)

Click to expand commit body
Closes #ISSUE

Release Notes:

- Improved app responsiveness when spawning Rust tasks.

Piotr Osiewicz created