This PR is a follow-up to
https://github.com/zed-industries/zed/pull/16216, as we want to run the
`/docs` command when completing a suggested package that has yet to be
indexed.
Release Notes:
- N/A
* renames `/tabs` to `/tab`
* allows to insert multiple tabs when fuzzy matching by the names
* improve slash command completion API, introduce a notion of multiple
arguments
* properly fire off commands on arguments' completions with
`run_command: true`
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <marshall@zed.dev>
Closes#16194
This PR introduces the following changes:
1. Updated the download process to retrieve the `.exe` file, as the API
response indicates that the `.exe` file should be downloaded on Windows.
> API response:
"https://supermaven-public.s3.amazonaws.com/sm-agent/26/windows/amd64/sm-agent.exe"
2. Modified the startup behavior of supermaven to prevent the cmd window
from appearing.
Release Notes:
- N/A
I've looked for other instances of the popover component where this change could cause a spacing regression but couldn't find any yet. Let me know if you do! Intuitively, I wouldn't change this padding directly on the component container, but I didn't find any other way to tackle it.
Release Notes:
- N/A
Previously, we were only looking at a simple syntax node name at a time
and not the full path to an item. E.g. in a rust-toolchain.toml file:
```rs
[toolchain]
targets = [ "x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-unknown-linux-gnu", "wasm32-wasi" ]
```
When matching against a query "toolchain targets" from the Assistant,
we'd try to match it against "toolchain" and "targets" and not against
"toolchain targets" - we only look at the name of the innermost node and
not it's full path.
I'd expect it to significantly improve precision of outline item
matching.
Release Notes:
- N/A
Co-authored-by: Bennet Bo <bennet@zed.dev>
This PR:
- Makes slash commands easier to compose by adding a concept,
`CompletionIntent`. When using `tab` on a completion in the assistant
panel, that completion item will be expanded but the associated command
will not be run. Using `enter` will still either run the completion item
or continue command composition as before.
- Fixes a bug where running `/diagnostics` on a project with no
diagnostics will delete the entire command, rather than rendering an
empty header.
- Improves the autocomplete rendering for files, showing when
directories are selected and re-arranging the results to have the file
name or trailing directory show first.
<img width="642" alt="Screenshot 2024-08-13 at 8 12 43 PM"
src="https://github.com/user-attachments/assets/97c96cd2-741f-4f15-ad03-7cf78129a71c">
Release Notes:
- N/A
Some prompt changes to highlight:
- Removes `<rewrite_section>` rendering, preferring to just show
`<rewrite_section_with_selections>`
- Concise, terse instructions throughout
I'd like to have experimented with prefilling the assistant response,
but I don't think OpenAI allows for that and wouldn't want to break
compatibility with gpt-4 et al.
Release Notes:
- N/A
This PR promotes package suggestions to a first-class concept on the
`IndexedDocsProvider` trait.
This will allow any implementer of `IndexedDocsProvider` to provide a
list of package names to suggest for use with `/docs`.
For the docs.rs provider we use the 250 most popular Rust crates (as
identified [here](https://lib.rs/std)), and for the rustdoc provider we
use the packages in the Cargo workspace.
Release Notes:
- N/A
- Make `ctrl-a` and `ctrl-e` ignore soft_wraps on MacOS, matching the behavior of VSCode.
- Unchanged: `home`, `end`, `cmd-left`, `cmd-right` respect softwrap (both in Zed and VSCode).
/rant on
We have this issue where if a prompt starts with a slash command (e.g.
/workflow), the rendering is a bit messed up. The nested slash command
gets picked up as the parent of a command that includes it (/prompt).
This is due to how we parse slash commands; their output is obtained
asynchronously. When we run `/prompt "My prompt"` whose contents are
`/workflow`, we first include the prompt content verbatim and then
reparse the whole buffer, picking up /workflow as a new command (as if
it was typed by an user). The problem with that is that the range of
parent /prompt does not include the expanded range of a /workflow; in
fact, after doing full expansion of "My prompt", we lose track of the
parent-children relationship of these two slash commands and treat them
as if top-level user prompt was `/workflow/prompt "My prompt"` and not
`/prompt "My prompt"` (which, by the way, would not be parsable for us).
The "proper" fix would be to update the parent range whenever we parse a
new children within it. We could do that. But then, the question is;
what do we gain from it? Slash command output is put behind a crease,
which is fundamentally a fold. Given "My prompt", we'd have to put two
fold indicators on a single line even if the ranges were set up
correctly. So that merely moves the target elsewhere into yet another
issue. Even if we did solve two-fold problem somehow (by e.g. sorting
same-line folds by the end point), we would still be stuck with
suboptimal render. What do we gain from all that anyways? Proper
handling of a relatively obscure (although - at the same time - quite
common) edge case which may as well be handled by having /prompt insert
a new line if there's a slight chance that the edge case could occur.
And that hacky, "inproper" solution is what this PR does; in fact, it's
not the first time it was done, as /default also has the same issue
which it solves in precisely the same manner.
/rant off
Release Notes:
- N/A
For future reference: WIP branch of copy/pasting a mixture of images and
text: https://github.com/zed-industries/zed/tree/copy-paste-images -
we'll come back to that one after landing this one.
Release Notes:
- You can now paste images into the Assistant Panel to include them as
context. Currently works only on Mac, and with Anthropic models. Future
support is planned for more models, operating systems, and image
clipboard operations.
---------
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Jason <jason@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
This PR improves the initial experience of using `/docs docs-rs` with an
empty index.
We now show a brief explainer of what is expected (a crate name) as well
as list some popular Rust crates to try:
<img width="540" alt="Screenshot 2024-08-13 at 12 25 39 PM"
src="https://github.com/user-attachments/assets/942de250-2901-45df-9e3e-52ff3b3fc517">
Release Notes:
- N/A
Debug inspector broke immediately after merge as #16036 landed in
parallel; one of the changes of that PR is removing any steps whose
content was edited, which is what debug inspector happened to do. The
fix is to make the edit right past the step block.
Release Notes:
- N/A
Follow-up of https://github.com/zed-industries/zed/pull/16154
Reworks /tabs arguments to allow:
* current tab by default, if no arguments are present
* fuzzy-matching over paths of the related tabs
* `all` case to insert all tabs at once
Release Notes:
- N/A
This PR reverts #16142, as it isn't what we want from a design
standpoint.
Having the file names misaligned from the folder names is not the
desired behavior:
<img width="243" alt="Screenshot 2024-08-13 at 11 16 53 AM"
src="https://github.com/user-attachments/assets/12914e89-2641-4932-96c2-00e89e56d6d7">
We can revisit when we have design bandwidth.
This reverts commit ee6a40137f.
Release Notes:
- Reverted #16142.
- @JosephTLyons @notpeter for release notes curation
This PR adds an `HttpRequestBuilder` to the extension API to allow for a
more ergonomic way for constructing HTTP requests within extensions.
The HTTP client functionality is now also exposed via the
`zed_extension_api::http_client` module instead of top-level.
Release Notes:
- N/A
This PR changes v0.0.7 of the extension API to v0.1.0.
We had a false-start in releasing v0.0.7, which has since been yanked,
so we need a new version number. We'll publish v0.1.0 to crates.io once
the Preview build is out tomorrow.
We're incrementing the minor version so that we have some leeway in
putting out patch releases of the crate within a given extension API
release.
Release Notes:
- N/A
Update zed.desktop.in to include the MimeType for empty files.
Seems to be the default for all "text editors" .desktop files.
Release Notes:
- Improved MimeType list in XDG .desktop file
Now, tabs have arguments, `active` (default, applied also for no
arguments case) and `all` to insert the active tab only or all tabs.
Release Notes:
- N/A
This adds a pulsating effect to the assistant header in case the message
is pending.
The pulsating effect is capped between 0.2 and 1.0 and I tried (with the
help of Claude) to give it a "breathing" effect, since I found the
normal bounce a bit too much.
Also opted for setting the `alpha` on the `LabelLike` things, vs.
overwriting the color, since I think that's cleaner instead of exposing
the color and mutating that.
https://github.com/user-attachments/assets/4a94a1c5-8dc7-4c40-b30f-d92d112db7b5
Release Notes:
- N/A
This PR simplifies our approach to indentation in the inline assistant
in hopes of improving our experience for Python. We tell the model to
generate the correct indentation in the prompt, and always start
generating at the start of the line. This may fall down for less capable
models, but I want to get a solid experience on the best models and then
figure the rest out later.
Also: We now prefer `./assets/prompts` as an overrides directory when
stdout is a PTY, so you can do `cargo run` and then iterate prompts for
the current run inside the current working copy.
cc @trishume @dsp-ant
Release Notes:
- Zed now allows the model to control indentation when performing inline
transformation. We're hoping this improves the indentation experience in
Python and other indentation-sensitive languages, but it does require
more from the model.
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
This PR adds the ability to revoke access tokens for the LLM service.
There is a new `revoked_access_tokens` table that contains the
identifiers (`jti`) of revoked access tokens.
To revoke an access token, insert a record into this table:
```sql
insert into revoked_access_tokens (jti) values ('1e887b9e-37f5-49e8-8feb-3274e5a86b67');
```
We now attach the `jti` as `authn.jti` to the tracing spans so that we
can associate an access token with a given request to the LLM service.
Release Notes:
- N/A