Commit Graph

19705 Commits

Author SHA1 Message Date
Kyle Kelley
f990f70936
Bring the Tool Calling README up to date (#11683) 2024-05-12 04:47:19 -07:00
Conrad Irwin
f550f23b97
vim test redux (#11709)
This cleans up the neovim-backed vim tests:
- removed exempted tests (we'll rely on bug reports to find missing edge
cases)
- moved all assertions into non-async fn's so that failures are
reporting on the right file/line
- removed the NeovimBackedBindingTestContext
- renamed a few things to make them clearer
- reduced the number of permutations tested in some cases to reduce
slowest test from 60s to 5s

Release Notes:

- N/A
2024-05-11 14:04:05 -04:00
Kirill Bulatov
48cba328f2 Revert "Use sha in the names of Linux nightly archives (#11693)"
This reverts commit 6a64360ec8.
2024-05-11 12:04:49 +03:00
Kirill Bulatov
6a64360ec8
Use sha in the names of Linux nightly archives (#11693)
Release Notes:

- N/A
2024-05-11 11:14:49 +03:00
Piotr Osiewicz
fa04f7514e
chore: Improve dev build startup time (#11692)
RustEmbed repeatedly compiled regexes for handling of
'include='/'exclude' statements in a hot loop, which caused each call to
Assets::iter() to take 600ms. Since it is being called twice on our
startup path, that alone contributed over a second to startup time in
debug builds. I've filed a PR with them
https://github.com/pyrossh/rust-embed/pull/244 which brings down the
time for a single iter() call to 6ms.

Release Notes:

- N/A
2024-05-11 10:10:13 +02:00
Maksim Bondarenkov
69676c9d33
update ring dependency (#11689)
this updates ring dependency to 0.17.x version, which has Windows on ARM
support

Release Notes:

- N/A
2024-05-11 09:44:58 +02:00
Kalle Ahlström
b8a83443ac
editor: Support walking through overlapping diagnostics (#11139)
While looking into how to implement #4901, noticed that the current
`Goto next/previous diagnostic` behaved a bit weirdly. That is, when
there are multiple errors that have overlapping ranges, only the first
one can be chosen to be active by the `go_to_diagnostic_impl`.

### Previous behavior:


https://github.com/zed-industries/zed/assets/71292737/95897675-f5ee-40e5-869f-0a40066eb8e3

Doesn't go through all the diagnostics, and going backwards and forwards
doesn't show the same diagnostic always.

### New behavior:


https://github.com/zed-industries/zed/assets/71292737/81f7945a-7ad8-4a34-b286-cc2799b10500

Should always go through the diagnostics in a consistent manner.

Release Notes:
* Improved the behavioral consistency of "Go to Next/Previous
Diagnostic"
2024-05-11 00:32:49 +02:00
Kyle Kelley
c71cfd5da4
Change ToolOutput to ToolView (#11682)
Additionally, the internal `ToolView` trait used by the registry is now
called `InternalToolView`.

This should make it a bit easier to understand that the `ToolView` is
intended for a `gpui::View` (implementing `Render`). It does still feel
like more could be merged here but I think the built tools are now a bit
clearer.

Release Notes:

- N/A
2024-05-10 15:22:09 -07:00
Conrad Irwin
5515ba6043
Extract http from util (#11680)
This avoids the CLI linking libssl etc...

Release Notes:

- N/A
2024-05-10 15:50:20 -06:00
Kirill Bulatov
df41435d1a
Introduce DisplayRow, MultiBufferRow newtypes and BufferRow type alias (#11656)
Part of https://github.com/zed-industries/zed/issues/8081

To avoid confusion and bugs when converting between various row `u32`'s,
use different types for each.
Further PRs should split `Point` into buffer and multi buffer variants
and make the code more readable.

Release Notes:

- N/A

---------

Co-authored-by: Piotr <piotr@zed.dev>
2024-05-11 00:06:51 +03:00
Kyle Kelley
38f110852f
Improve prompts for tools (#11669)
Improves the descriptions for some of the tools. I wish we had metrics
to back up changes in how the model responds to tool schema changes so
anecdotally I'm just going to say this _seems_ improved.

Release Notes:

- N/A
2024-05-10 13:18:05 -07:00
Marshall Bowers
fc584017d1
ruby: Add embedded_template grammar (#11677)
This PR adds the `embedded_template` grammar to the Ruby extension, as
we need it present for ERB.

Release Notes:

- N/A
2024-05-10 16:08:46 -04:00
Conrad Irwin
451727d257
Create release archive in the target dir (#11675)
Release Notes:

- N/A
2024-05-10 13:48:48 -06:00
Conrad Irwin
c73d6502d6
Make block_with_timeout more robust (#11670)
The previous implementation relied on a background thread to wake up the
main thread,
which was prone to priority inversion under heavy load.

In a synthetic test, where we spawn 200 git processes while doing a 5ms
timeout, the old version blocked for 5-80ms, the new version blocks for
5.1-5.4ms.

Release Notes:

- Improved responsiveness of the main thread under high system load
2024-05-10 13:10:02 -06:00
Marshall Bowers
b34ab6f3a1
Remove references to submodules (#11673)
This PR removes the references to initializing Git submodules as part of
building Zed.

These are no longer needed, as our only submodule was removed in #11672.

Release Notes:

- N/A
2024-05-10 14:33:53 -04:00
Marshall Bowers
c9738a233e
Vendor LiveKit protocol (#11672)
This PR vendors the protobuf files from the LiveKit protocol so that we
don't need to have that entire LiveKit protocol repo as a submodule.

---

Eventually I would like to replace this with the
[`livekit-protocol`](https://crates.io/crates/livekit-protocol) crate,
but there is some churn that needs to happen for that.

The main problem is that we're currently on a different version of
`prost` used by `livekit-protocol`, and upgrading our version of `prost`
means that we now need to source `protoc` ourselves (since it is no
longer available to be compiled from source as part of `prost-build`).

Release Notes:

- N/A
2024-05-10 14:18:40 -04:00
Robert Falkén
80d3eafa30
Alternate files with ctrl-6 (#11367)
This is my stab at #7709 

I realize the code is flawed. There's no test coverage, I'm using
`clone()` and there are probably better ways to hook into the events.
Also, I didn't know what context to use for the keybinding. But maybe
with some pointers from someone who actually know what they're doing, I
can get this shippable.

Release Notes:

- vim: Added ctrl-6 for
[alternate-file](https://vimhelp.org/editing.txt.html#CTRL-%5E) to
navigate back and forth between two buffers.



https://github.com/zed-industries/zed/assets/261929/2d10494e-5668-4988-b7b4-417c922d6c61

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-05-10 11:40:08 -06:00
Marshall Bowers
0d26beb91b
Add configurable low-speed timeout for OpenAI provider (#11668)
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)).
2024-05-10 13:19:21 -04:00
Marshall Bowers
19994fc190
ruby: Move injections to extension (#11664)
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
2024-05-10 12:06:15 -04:00
Ulysse Buonomo
4f256c7577
Add Ruby language injections (#8796)
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">
2024-05-10 09:00:51 -07:00
Vitaly Slobodin
400e938997
Extract Ruby extension (#11360)
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>
2024-05-10 11:53:11 -04:00
Piotr Osiewicz
df00854bbc
gpui: Bump taffy to 0.4.3 again (#11655)
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:
df190ea846/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
2024-05-10 15:05:50 +02:00
Thorsten Ball
df190ea846
vcs menu: Use project's repositories, do not open directly (#11652)
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
2024-05-10 11:06:32 +02:00
Piotr Osiewicz
b3dc31d7c9
tasks: Filter out run indicators outside of excerpt bounds instead of using saturating_sub (#11634)
This way we'll display run indicators around excerpt boundaries
correctly.

Release Notes:

- N/A
2024-05-10 10:45:28 +02:00
Antonio Scandurra
358bc2d225
Replace rich_text with markdown in assistant2 (#11650)
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
2024-05-10 10:22:14 +02:00
Conrad Irwin
0d760d8d19
Clarify key binding documentation (#11644)
Fixes #10762

Release Notes:

- N/A
2024-05-09 22:42:09 -06:00
Conrad Irwin
45f12b9426
vim cl (#11641)
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
2024-05-09 21:18:56 -06:00
Conrad Irwin
4f9ba28a25
linux cli (#11585)
- [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
2024-05-09 21:08:49 -06:00
Conrad Irwin
0c2d71f1ac
Remove 'Destructive' prompts (#11631)
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
2024-05-09 18:52:09 -06:00
Zachiah Sawyer
901cb8b3d2
vim: Add basic mark support (#11507)
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>
2024-05-09 18:51:19 -06:00
Kyle Kelley
9cef0ac869
Cleanup tool registry API surface (#11637)
Fast followups to #11629 

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-05-09 16:43:27 -07:00
Kirill Bulatov
79b5556267
Remove a stray eprintln (#11635)
Release Notes:

- N/A
2024-05-10 02:27:55 +03:00
Marshall Bowers
dd67bda595
Update .mailmap (#11633)
This PR updates the `.mailmap` file to merge some commit authors using
multiple emails.

Release Notes:

- N/A
2024-05-09 19:03:34 -04:00
Kirill Bulatov
4762e52d31
Properly calculate expanded git diff hunk highlight ranges (#11632)
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))
2024-05-10 02:02:56 +03:00
Kyle Kelley
50c45c7897
Streaming tools (#11629)
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>
2024-05-09 15:57:14 -07:00
Marshall Bowers
27ed0f4273
assistant2: Render saved conversations inline instead of in a modal (#11630)
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
2024-05-09 18:29:08 -04:00
Conrad Irwin
a3e75540af
Reduce serializability of project delete (#11628)
This may reduce locks when deleting projects.

Release Notes:

- N/A
2024-05-09 16:17:13 -06:00
Conrad Irwin
aa5113cd92
vim: Support paste with count (#11621)
Fixes: #10842



Release Notes:

- vim: Fix pasting with a count (#10842)
2024-05-09 16:12:59 -06:00
Kirill Bulatov
bca639bda9
Use larger runners for Linux CI steps (#11574)
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
2024-05-10 00:44:31 +03:00
Piotr Osiewicz
bff1d8b142
task: Allow obtaining custom task variables from tree-sitter queries (#11624)
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>
2024-05-09 23:38:18 +02:00
张小白
95e246ac1c
windows: Better dispatcher (#11485)
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
2024-05-09 14:24:57 -07:00
Andrew Lygin
ba25e371be
Fix scrollbar markers for folded code (#11625)
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
2024-05-09 14:23:21 -07:00
Marshall Bowers
c73ef1a5f3
assistant2: List saved conversations from disk (#11627)
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
2024-05-09 16:17:07 -04:00
Conrad Irwin
8b5a0cff10
vim: Fix e/E with inlay hints (#11616)
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>
2024-05-09 13:45:45 -06:00
Piotr Osiewicz
f0af508ae5
Revert "chore: Bump taffy version to 0.4.3" (#11622)
Reverts zed-industries/zed#11606
2024-05-09 19:11:37 +02:00
Marshall Bowers
5fe4070501
docs: Fix copying code blocks (#11617)
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
2024-05-09 11:52:26 -04:00
Marshall Bowers
981a143e9b
copilot: Update root path on Windows (#11613)
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>
2024-05-09 10:14:29 -04:00
Jason Lee
5e06ce4df3
Add zip extract support for Windows (#11156)
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>
2024-05-09 09:23:21 -04:00
Piotr Osiewicz
3bd53d0441
chore: Bump taffy version to 0.4.3 (#11606)
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:
-
563d5dcee7
-
64f8aa0fb1
-
70b35712a2

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

Release Notes:

- N/A
2024-05-09 12:51:53 +02:00
Piotr Osiewicz
76535578e9
Task indicators in multibuffers (#11603)
Following #11487 the task indicators would no longer show up in
multibuffers.
Release Notes:

- N/A
2024-05-09 12:22:33 +02:00