This PR restructures the ambient context in the `assistant` crate to
make it more amenable to adding more kinds of ambient context.
Release Notes:
- N/A
If you go to the file tree and press "x" (which is
"project_panel::RevealInFinder"). It will open the default file
manager(in my case nautilus). But on Linux it makes Zed unresponsive.
This fixes that.
Release Notes:
- Fixed Zed blocked after opening file manager in the file tree on
Linux.
Zed can detect changes in monitor connections and disconnections and
provide corresponding feedback. For example, if the current window's
display monitor is disconnected, the window will be moved to the primary
monitor. And now Zed always opens on the monitor specified in
`WindowParams`.
Release Notes:
- N/A
Release Notes:
- Added support for interacting with Claude in the assistant panel. You
can enable it by adding the following to your `settings.json`:
```json
"assistant": {
"version": "1",
"provider": {
"name": "anthropic"
}
}
```
<img width="1637" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/5aaec657-3499-42c9-9528-c83728f2a7a1">
Release Notes:
- Added a new ambient context feature that allows showing the model up
to three buffers (along with their diagnostics) that the user interacted
with recently.
---------
Co-authored-by: Nathan Sobo <nathan@zed.dev>
![image](https://github.com/zed-industries/zed/assets/24362066/bc7cc3d3-d9fc-4be6-b9b6-e3d8edf5b533)
Release Notes:
- Improved tasks modal by highlighting a distinction between a task
template and concrete task instance and surfacing available keybindings
more prominently. Task templates are now always available in the modal,
even if there's already a history entry with the same label.
- Changed default key binding for "picker::UseSelectedQuery" to `opt-e`.
This fixes#8794 and other related problems.
The problem, in short, is this: `$SHELL` might be outdated. This code
ensures that we update `$SHELL` to what we can deem the newest version,
if we're started as a desktop application.
The background is that you can get the user's preferred shell in two
ways:
1. Read the `SHELL` env variable
2. Read the `/etc/passwd` file and check which shell is set
Most applications should and do prefer (1) over (2).
Why is it preferred? Reading `SHELL` means that processes can inherit
the variable from each other. And you can do something like
`SHELL=/bin/cool-shell ./my-cool-app`
But what happens if the application was launched from the desktop? Which
SHELL env does it inherit then?
It inherits the env from the process that launched it, which is
Finder.app or launchd or GNOME or something else — these are all
long-running processes that get their environment when the user logs in.
They do *not* get a new environment unless restarted (either process
restarted or computer restarted)
That means the `SHELL` env variable they have might be outdated.
That's a problem if you, for example, change your shell with `chsh` and
then launch the app from the desktop.
That change of the default shell is not reflected in the app if the app
only reads from SHELL. Because that hasn’t been updated. Instead it
should read from passwd file to get the newest value.
Release Notes:
- Fixed SHELL being outdated if Zed was launched via Finder or Raycast
or other desktop launchers.
([#8794](https://github.com/zed-industries/zed/issues/8794))
This PR adds a new `cargo xtask licenses` command for finding crates
with missing license files.
A number of crates were uncovered that were missing a license file, and
have had the appropriate license file added.
Release Notes:
- N/A
This fixes#10185 by not keeping snippet state around when already at
the end of the snippet and the tabstop is empty (i.e. it's not a
selection) and we're already on it.
The reason for the fix is outlined in the comments of #10185 but to
repeat:
1. `gopls` sends completions with type "snippet" even when suggesting
single word completions that don't contain tabstops
2. We use a default behavior and add an "end tabstop" by default so that
the cursor jumps to the end of the snippet when accepting it.
3. We'd then push the state of the snippet on the stack which is where
it would stay, with the cursor already at the end and the user unable to
get rid of the tabstop state.
This fixes the issue by not pushing snippet state when the tabstop we
accepted is the "end tabstop".
Release Notes:
- Fixed completions inside snippets breaking the jump-to-next-tabstop
behaviour when using Go/`gopls`
([#10185](https://github.com/zed-industries/zed/issues/10185)).
Demo:
https://github.com/zed-industries/zed/assets/1185253/35384e5e-45c6-46ab-870d-b48e56d8786b
This adds a new option to the right click menu for git blame entries in
the gutter: "Open permalink". If there is a URL for the code host, then
this will open it.
Release Notes:
- Added "Open permalink" option to right-click menu of git blame entries
in gutter.
Demo:
![screenshot-2024-05-13-09 39
48@2x](https://github.com/zed-industries/zed/assets/1185253/656c177c-79f0-4a40-8838-7e963d099479)
Implemented autosave functionality with a delay, which now refrains from
formatting the code upon triggering unless the user manually saves it.
Additionally, enhanced documentation for the `format_on_save` setting
has been added. This resolves the issue where autosave with delay would
inadvertently format the code, disrupting the user experience, as
reported in the corresponding issue.
Release Notes:
- Fixed a bug where autosave after_delay would auto-format the buffer
([#9787](https://github.com/zed-industries/zed/issues/9787)).
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This PR adds an extra scrollbar-wide margin to the right side of the
editor. This prevents hiding the last character under the scrollbar.
Fixes#7098
Release Notes:
- Fixed hiding of the last character under the scrollbar (#7098).
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
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
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"
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
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>
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
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
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
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>
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)).