Commit log

0d26beb Add configurable low-speed timeout for OpenAI provider (#11668)

Click to expand commit body
This PR adds a setting to allow configuring the low-speed timeout for
the Assistant when using the OpenAI provider.

The `low_speed_timeout_in_seconds` accepts a number of seconds that the
HTTP client can go below a minimum speed limit (currently set to 100
bytes/second) before it times out.

```json
{
  "assistant": {
    "version": "1",
    "provider": { "name": "openai", "low_speed_timeout_in_seconds": 60 }
  },
}
```

This should help the case where the `openai` provider is being used with
a local model that requires higher timeouts.

Issue: https://github.com/zed-industries/zed/issues/9913

Release Notes:

- Added a `low_speed_timeout_in_seconds` setting to the Assistant's
OpenAI provider
([#9913](https://github.com/zed-industries/zed/issues/9913)).

Marshall Bowers created

19994fc ruby: Move injections to extension (#11664)

Click to expand commit body
This PR moves the Ruby injections added in #8796 to the right location,
since Ruby support was extracted into an extension in #11360.

Release Notes:

- N/A

Marshall Bowers created

4f256c7 Add Ruby language injections (#8796)

Click to expand commit body
This adds support for Ruby heredoc's syntax highlighting. The injection
was directly taken from the tree-sitter
[documentation](https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection).

It is quite simple, but has the drawback of only showing highlighting
once the heredoc is fully written and next line is started. This is due
to the fact that we use the last line of the heredoc to determine the
language. As using the first one would require some cleaning up that we
cannot do trivially. (I might have not fully understood the behaviour of
the `#match?` predicate, which could help us)

Fixes #4473



Release Notes:

- Added Ruby language injections
([#4473](https://github.com/zed-industries/zed/issues/4473)).

<img width="359" alt="image"
src="https://github.com/zed-industries/zed/assets/11378424/5115b875-a32d-4f28-b21f-471495169266">

Ulysse Buonomo created

400e938 Extract Ruby extension (#11360)

Click to expand commit body
This PR extracts Ruby and ERB support into an extension and removes the
built-in Ruby and Ruby support from Zed.

As part of this, the new extension is prepared for adding support for
the `Ruby LSP` which has some blockers. See
https://github.com/zed-industries/zed/pull/8613 I was thinking of adding
an initial support for Ruby LSP but I think it would be better to start
with extracting the Ruby extension for now.

The implementation, as the 1st step, matches the bundled version but
with 3 differences:

1. Added signature output to the completion popup. See my comment below.
![CleanShot 2024-05-04 at 09 17
37@2x](https://github.com/zed-industries/zed/assets/1894248/486b7a48-ea0c-44ce-b0c9-9f8f5d3ad42d)

3. Use the shell environment for starting the `solargraph` executable.
See my comment below.
4. Bumped the tree sitter version for Ruby to the latest available
version.

Additionally, I plan to tweak this extension a bit in the future but I
think we should do this bit by bit. Thanks!

Release Notes:

- Removed built-in support for Ruby, in favor of making it available as
an extension.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>

Vitaly Slobodin and Marshall Bowers created

df00854 gpui: Bump taffy to 0.4.3 again (#11655)

Click to expand commit body
We reverted bump to taffy 0.4.3 following an issue spotted by
@maxdeviant where chat text input was not being rendered correctly:

![image](https://github.com/zed-industries/zed/assets/24362066/9d7e6444-47b1-4ac2-808f-bf10404377c0)
This was an issue with the previous attempt to upgrade to taffy 0.4.0 as
well. We bail early in `compute_auto_height_layout` due to a missing
width:
https://github.com/zed-industries/zed/blob/df190ea84621837c44fa50c62837bdbea04b9e22/crates/editor/src/element.rs#L5266
The same issue is visible in story for auto-height editor (or rather,
the breakage is visible - the editor simply does not render at all
there).

I tracked down the breakage to
https://github.com/DioxusLabs/taffy/pull/573 ; it looks like it
specifically affects editors with auto-height. In taffy <0.4 which we
were using previously, we'd eventually get a proper width for
auto-height EditorElement after having initially computed the size. With
taffy 0.4 however (and specifically that PR mentioned earlier), we're
getting `Size::NONE` in layout phase [^1].
I've noticed though that even with taffy <0.3, the
`known_dimensions.width` was always equal to `available_space.width` in
layout phase. Hence, I went with falling back to `available_space.width`
when it is a definite value and we don't have a
`known_dimensions.width`.
Done this way, both chat input and auto-height story render correctly.
/cc @as-cii 
Related:
https://github.com/zed-industries/zed/pull/11606
https://github.com/zed-industries/zed/pull/11622
https://github.com/zed-industries/zed/pull/7868
https://github.com/zed-industries/zed/pull/7896

[^1]: This could possibly be related to change in what gets passed in
https://github.com/DioxusLabs/taffy/pull/573/files#diff-60c916e9b0c507925f032cecdde6ae163e41b84b8e4bc0a6c04f7d846b0aad9eR133
, though I'm not sure if editor is a leaf node in this case

Release Notes:

- N/A

Piotr Osiewicz created

df190ea vcs menu: Use project's repositories, do not open directly (#11652)

Click to expand commit body
I ran into this when trying to get #11550 working: the VCS menu would
open repositories on its owned, based on paths, instead of going through
the worktree on which we already store the git repositories.



Release Notes:

- N/A

Thorsten Ball created

b3dc31d tasks: Filter out run indicators outside of excerpt bounds instead of using saturating_sub (#11634)

Click to expand commit body
This way we'll display run indicators around excerpt boundaries
correctly.

Release Notes:

- N/A

Piotr Osiewicz created

358bc2d Replace `rich_text` with `markdown` in `assistant2` (#11650)

Click to expand commit body
We don't implement copy yet but it should be pretty straightforward to
add.


https://github.com/zed-industries/zed/assets/482957/6b4d7c34-de6b-4b07-aed9-608c771bbbdb

/cc: @rgbkrk @maxbrunsfeld @maxdeviant 

Release Notes:

- N/A

Antonio Scandurra created

0d760d8 Clarify key binding documentation (#11644)

Click to expand commit body
Fixes #10762

Release Notes:

- N/A

Conrad Irwin created

45f12b9 vim cl (#11641)

Click to expand commit body
Release Notes:

- vim: Added support for the changelist. `g;` and `g,` to the
previous/next change
- vim: Added support for the `'.` mark
- vim: Added support for `gi` to resume the previous insert

Conrad Irwin created

4f9ba28 linux cli (#11585)

Click to expand commit body
- [x] Build out cli on linux
- [x] Add support for --dev-server-token sent by the CLI
- [x] Package cli into the .tar.gz
- [x] Link the cli to ~/.local/bin in install.sh

Release Notes:

- linux: Add cli support for managing zed

Conrad Irwin created

0c2d71f Remove 'Destructive' prompts (#11631)

Click to expand commit body
While these would match how macOS handles this scenario, they crash on
Catalina, and require mouse clicks to interact.

cc @bennetbo



Release Notes:

- N/A

Conrad Irwin created

901cb8b vim: Add basic mark support (#11507)

Click to expand commit body
Release Notes:
- vim: Added support for buffer-local marks (`'a-'z`) and some builtin
marks `'<`,`'>`,`'[`,`']`, `'{`, `'}` and `^`. Global marks (`'A-'Z`),
and other builtin marks (`'0-'9`, `'(`, `')`, `''`, `'.`, `'"`) are not
yet implemented. (#5122)

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

Zachiah Sawyer and Conrad Irwin created

9cef0ac Cleanup tool registry API surface (#11637)

Click to expand commit body
Fast followups to #11629 

Release Notes:

- N/A

---------

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

Kyle Kelley and Max created

79b5556 Remove a stray eprintln (#11635)

Click to expand commit body
Release Notes:

- N/A

Kirill Bulatov created

dd67bda Update `.mailmap` (#11633)

Click to expand commit body
This PR updates the `.mailmap` file to merge some commit authors using
multiple emails.

Release Notes:

- N/A

Marshall Bowers created

4762e52 Properly calculate expanded git diff hunk highlight ranges (#11632)

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

Release Notes:

- Fixed expanded diff hunks highlighting an extra row as added
([11576](https://github.com/zed-industries/zed/issues/11576))

Kirill Bulatov created

50c45c7 Streaming tools (#11629)

Click to expand commit body
Stream characters in for tool calls to allow rendering partial input.


https://github.com/zed-industries/zed/assets/836375/0f023a4b-9c46-4449-ae69-8b6bcab41673

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Max <max@zed.dev>

Kyle Kelley , Max Brunsfeld , Marshall , and Max created

27ed0f4 assistant2: Render saved conversations inline instead of in a modal (#11630)

Click to expand commit body
This PR reworks how saved conversations are rendered in the new
assistant panel.

Instead of rendering them in a modal we now display them in the panel
itself:

<img width="402" alt="Screenshot 2024-05-09 at 6 18 40 PM"
src="https://github.com/zed-industries/zed/assets/1486634/82decc04-cb31-4d83-a942-7e8426e02679">

Release Notes:

- N/A

Marshall Bowers created

a3e7554 Reduce serializability of project delete (#11628)

Click to expand commit body
This may reduce locks when deleting projects.

Release Notes:

- N/A

Conrad Irwin created

aa5113c vim: Support paste with count (#11621)

Click to expand commit body
Fixes: #10842



Release Notes:

- vim: Fix pasting with a count (#10842)

Conrad Irwin created

bca639b Use larger runners for Linux CI steps (#11574)

Click to expand commit body
To speed up Linux CI builds, use a set of self-hosted Linux machines and
use them to run all slow CI steps for Linux: "tests", bundling and
nightly builds.

Also adds a set of dev icons as Linux bundling script required them for
`run-bundling`-tagged builds from regular PRs.
Same icons as for Preview were used, but, ideally, something different
could be created.

Release Notes:

- N/A

Kirill Bulatov created

bff1d8b task: Allow obtaining custom task variables from tree-sitter queries (#11624)

Click to expand commit body
From now on, only top-level captures are treated as runnable tags and
the rest is appended to task context as custom environmental variables
(unless the name is prefixed with _, in which case the capture is
ignored). This is most likely gonna help with Pest-like test runners.



Release Notes:

- N/A

---------

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

Piotr Osiewicz and Remco created

95e246a windows: Better dispatcher (#11485)

Click to expand commit body
This PR leverages a more modern Windows API to implement
`WindowsDispatcher`, aligning its implementation more closely with that
of the `macOS` platform. The following improvements have been made:

1. Similar to `macOS`, there is no longer a need to use `sender` and
`receiver` to dispatch a `Runnable` on the main thread.
2. There is also no longer a need to use an `Event` for synchronization.
3. Consistent with #7506 and #11269, `Runnable` is now executed with
high priority.

However, this PR raises the minimum Windows version requirement of
`GPUI` to Windows 10, specifically Windows 10 Fall Creators Update
(10.0.16299). However, the `alacritty_terminal` dependency in Zed relies
on `conPTY` on Windows, an API introduced in the Windows 10 Fall
Creators Update. Therefore, the impact of this PR on Zed should be
minimal. I'd like to hear your voices about this PR, especially about
the minimum Windows version bumping.

Release Notes:

- N/A

张小白 created

ba25e37 Fix scrollbar markers for folded code (#11625)

Click to expand commit body
There're two errors in scrollbar markers in the presence of folded code:

1. Some markers are not displayed (when the marked row numbers are
greater than the total displayed rows count after folding).
2. Code folding / unfolding doesn't trigger markers repainting.

This PR fixes both problems.

Release Notes:

- Fixed scrollbar markers for folded code.

The second problem (markers are repainted after I move the cursor, not
after folding):


https://github.com/zed-industries/zed/assets/2101250/57ed563d-186d-4497-98ab-d4f946416726

Andrew Lygin created

c73ef1a assistant2: List saved conversations from disk (#11627)

Click to expand commit body
This PR updates the saved conversation picker to use a list of
conversations retrieved from disk instead of the static placeholder
values.

Release Notes:

- N/A

Marshall Bowers created

8b5a0cf vim: Fix e/E with inlay hints (#11616)

Click to expand commit body
Co-Authored-By: Sergey <sergey.b@hey.com>
Fixes: #7046

Release Notes:

- vim: Fixes e/E with inlay hints (#7046)

Co-authored-by: Sergey <sergey.b@hey.com>

Conrad Irwin and Sergey created

f0af508 Revert "chore: Bump taffy version to 0.4.3" (#11622)

Click to expand commit body
Reverts zed-industries/zed#11606

Piotr Osiewicz created

5fe4070 docs: Fix copying code blocks (#11617)

Click to expand commit body
This PR fixes copying code blocks in the docs.

The problem was that some of the elements we removed from the base
mdBook template were causing errors in the script, which prevented the
right event listeners from being registered for the copy button.

To remedy this, the elements have been restored, but are using `display:
none` so that they don't appear in the UI.

Resolves #11592.

Release Notes:

- N/A

Marshall Bowers created

981a143 copilot: Update root path on Windows (#11613)

Click to expand commit body
This PR updates the root path used by Copilot to be a validate path when
running on Windows.

Release Notes:

- N/A

Co-authored-by: Jason Lee <huacnlee@gmail.com>

Marshall Bowers and Jason Lee created

5e06ce4 Add `zip` extract support for Windows (#11156)

Click to expand commit body
Release Notes:

- [x] Fixed install Node.js runtime and NPM lsp installation on Windows.
- [x] Update Node runtime command to execute on Windows with no window
popup.

Ref #9619, #9424

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>

Jason Lee and Marshall Bowers created

3bd53d0 chore: Bump taffy version to 0.4.3 (#11606)

Click to expand commit body
Taffy 0.4 has been released 2 months ago. We've been using an older
commit from their 0.4 development branch since November.
Compared to the commit we were pinned to, the following relevant changes
have been made:
-
https://github.com/DioxusLabs/taffy/commit/563d5dcee7b9138b4c3f865155d036a8b7597e65
-
https://github.com/DioxusLabs/taffy/commit/64f8aa0fb114d939ca0d53ddc44045a03fde548d
-
https://github.com/DioxusLabs/taffy/commit/70b35712a2e79b6fdfef4cff4392ca94287cd0b1

![image](https://github.com/zed-industries/zed/assets/24362066/ffdfae03-2743-496f-bb21-7aa38462178f)

Release Notes:

- N/A

Piotr Osiewicz created

7653557 Task indicators in multibuffers (#11603)

Click to expand commit body
Following #11487 the task indicators would no longer show up in
multibuffers.
Release Notes:

- N/A

Piotr Osiewicz created

fdcedf1 editor: Do not show test indicators if a line is folded (#11599)

Click to expand commit body
Originally reported by @RemcoSmitsDev



Release Notes:

- N/A

Piotr Osiewicz created

bd6d385 gpui: Pass Style by value to request_layout (#11597)

Click to expand commit body
A minor thing I've spotted and decided to fix on the spot.
It was being cloned twice within the body of that function (one of which
was redundant even without this PR); now in most cases we go down from 2
clones to 0.
Release Notes:

- N/A

Piotr Osiewicz created

5df1481 Introduce a new `markdown` crate (#11556)

Click to expand commit body
This pull request introduces a new `markdown` crate which is capable of
parsing and rendering a Markdown source. One of the key additions is
that it enables text selection within a `Markdown` view. Eventually,
this will replace `RichText` but for now the goal is to use it in the
assistant revamped assistant in the spirit of making progress.

<img width="711" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/b56c777b-e57c-42f9-95c1-3ada22f63a69">

Note that this pull request doesn't yet use the new markdown renderer in
`assistant2`. This is because we need to modify the assistant before
slotting in the new renderer and I wanted to merge this independently of
those changes.

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Alp <akeles@umd.edu>
Co-authored-by: Zachiah Sawyer <zachiah@proton.me>

Antonio Scandurra , Nathan Sobo , Conrad , Alp , and Zachiah Sawyer created

ddaaaee docs: Fix a typo (#11588)

Click to expand commit body
This PR fixes a typo in docs/src/development/debugging-crashes.md.

Release Notes:

- N/A

Doy Bachtiar created

9772b7a windows: Fix `Zed` freezing when resuming from sleep (#11589)

Click to expand commit body
It seems that on the first frame after the system resumes from sleep,
`dcomp_vsync_fn` mistakenly detects the `timer_stop_event` triggering
and exits the loop.

Release Notes:

- N/A

张小白 created

2e0811e windows: Improve platform clipboard (#11553)

Click to expand commit body
I thought platform clipboard should share one ctx. and fixed in vim
mode, read from clipboard crash when using `unwrap`.

Release Notes:

- N/A

CharlesChen0823 created

1b292d2 Fix crash when the length of a line is greater than 1024 chars (#11536)

Click to expand commit body
Close #11518 

Release Notes:

- N/A

张小白 created

adecbd1 Make Markdown default to `"format_on_save": "off"` (#11584)

Click to expand commit body
This PR changes the Markdown language defaults to set `format_on_save`
to be `off`.

Prettier's Markdown formatting is a bit controversial for some people,
so we turn it off by default.

To restore the previous behavior, add the following to your settings:

```json
{
  "languages": {
    "Markdown": {
      "format_on_save": "on"
    }
  }
}
```


Release Notes:

- Changed the default `format_on_save` behavior for Markdown files to be
`off`.

Marshall Bowers created

a7aa257 Implement serialization of assistant conversations, including tool calls and attachments (#11577)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>

Max Brunsfeld , Kyle , and Marshall created

24ffa0f Don't panic on failure to allocate an AtlasTile (#11579)

Click to expand commit body
Release Notes:

- Fixed a panic in graphics allocation

Conrad Irwin created

b0494d1 Pass hover position as an anchor (#11578)

Click to expand commit body
It's too easily to accidentally pass a point from one snapshot into
another

Release Notes:

- Fixed a panic in show hover

Conrad Irwin created

a89dc8c blade: Switch to linear color space (#11534)

Click to expand commit body
Release Notes:

- N/A

## What

Addresses a long-standing issue of doing the blending operations in sRGB
space. Currently, the input HSL colors are provided in sRGB space and
converted to linear in the vertex shader. Conversion back to sRGB, which
is required on most platforms today, happens at the very end of the
pipeline when writing into sRGB render target.

Note-1: in the future we may consider doing HSL -> sRGB -> Linear
transform on CPU before feeding into shaders. However, I don't expect
any significant difference here given that we are likely bound by fill
rate and pixel shaders, anyway.

Note-2: the graphics stack is programmed to detect if the platform
supports presenting in linear color space and avoids converting to sRGB
at the end in this case. However, on my Z13 laptop this isn't supported
by the RADV driver.

Closes #7684 
Closes #11462
@jansol please confirm if you can!

## Comparison

Screenshot of the Glazier theme before the change:

![glazier-old](https://github.com/zed-industries/zed/assets/107301/6a9552e1-0819-4a4e-8121-8d62ec012bf4)
Same theme after the change:

![glazier-new](https://github.com/zed-industries/zed/assets/107301/4e61c422-4a4b-4c4b-84a3-55680626d681)

Dzmitry Malyshau created

d103903 Style header for assistant2 (#11570)

Click to expand commit body
Release Notes:

- N/A

Nate Butler created

ec3aabe windows: Fix crash when saving files to disk (#11547)

Click to expand commit body
closes #11544, sorry for introduce this issue by pre pr.
Release Notes:

- N/A

CharlesChen0823 created

4b98c35 windows: Let IME early return in vim mode (#11551)

Click to expand commit body
This PR follows up #11387 , slightly changes the IME window behavior to
match macOS implementation.

Release Notes:

- N/A

张小白 created

5103995 windows: Fix incorrect font rendering (#11545)

Click to expand commit body
Previously, `DirectWrite` had been following the text system
implementation on `macOS`, using the font's postscript name to
differentiate between different font faces. However, I noticed
occasional rendering issues, such as fonts incorrectly rendering as
italics. Later, I discovered that on `Windows`, the postscript name is
**not** unique. Surprisingly, even the same font can have different
postscript names on macOS and Windows! It's hard to believe! The
postscript name of a font face should be obtained from the same font
table. Why would the same font face have different names?

For example, the postscript name of ZedMono on `macOS` is
`Zed-Mono-Bold-Extended-Italic`, while on `Windows`, it is
`Zed-Mono-Extended`, missing weight and style information, leading to
incorrect rendering.

This PR introduces a `FontIdentifier` struct to uniquely identify font
faces.

Release Notes:

- N/A

张小白 created

fb4c6db windows: Implement `ResizeColumn` and `ResizeRow` cursor style (#11533)

Click to expand commit body
This PR follows up #11406

Release Notes:

- N/A

张小白 created