Commit Graph

21379 Commits

Author SHA1 Message Date
Max Brunsfeld
8e9c2b1125
Introduce a separate backend service for LLM calls (#15831)
This PR introduces a separate backend service for making LLM calls.

It exposes an HTTP interface that can be called by Zed clients. To call
these endpoints, the client must provide a `Bearer` token. These tokens
are issued/refreshed by the collab service over RPC.

We're adding this in a backwards-compatible way. Right now the access
tokens can only be minted for Zed staff, and calling this separate LLM
service is behind the `llm-service` feature flag (which is not
automatically enabled for Zed staff).

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-05 20:26:21 -04:00
Marshall Bowers
4ed43e6e6f
collab: Ignore Stripe events that are older than an hour (#15830)
This PR makes it so any Stripe events we receive that occurred over an
hour ago are marked as processed.

We don't want to process an old event long after it occurred and
potentially overwrite more recent updates.

This also makes running collab locally a bit nicer, as we won't be
getting errors for a bunch of older events that will never get processed
successfully.

The period after time after which we consider an event "stale" can be
modified, as needed.

Release Notes:

- N/A
2024-08-05 17:15:38 -04:00
Kyle Kelley
f6a0fef5cf
repl: Address simple fixes (#15828)
Release Notes:

- Added logging in debug mode of raw kernel output from REPL.
- Fixed REPL kernels not being shut down completely on close of Editor
2024-08-05 13:48:15 -07:00
apricotbucket28
ab1fabef68
gpui: Align SVG sprites to whole pixels (#15822)
Related to https://github.com/zed-industries/zed/issues/12352 (and old
issue https://github.com/zed-industries/zed/issues/643)

This fixes visual glitches that could happen when rendering icons on
Linux and Windows (and in the Blade backend)


![image](https://github.com/user-attachments/assets/02646d1d-d35b-48be-89c9-189416510cf2)

![image](https://github.com/user-attachments/assets/ccf99867-25d2-40fb-8735-c540f8cf793a)

![image](https://github.com/user-attachments/assets/8d1124a3-669e-4be5-8b46-5dc2df14a28a)


Release Notes:

- Linux: Fixed visual glitches when rendering icons.
2024-08-05 12:43:23 -07:00
Max Brunsfeld
27779e33fb
Refactor: Restructure collab main function to prepare for new subcommand: serve llm (#15824)
This is just a refactor that we're landing ahead of any functional
changes to make sure we haven't broken anything.

Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Jason <jason@zed.dev>
2024-08-05 12:07:38 -07:00
Marshall Bowers
705f7e7a03
collab: Include geoip_country_code in initial span (#15819)
This PR changes how we report the `geoip_country_code` in the tracing
spans.

I wasn't seeing it come through in the logs, and I think it was because
we didn't declare the field on the initial span.

Release Notes:

- N/A
2024-08-05 12:24:47 -04:00
Marshall Bowers
04ad088eb8
assistant: Remove old model selector code (#15817)
This PR removes the old model selector code, as it was no longer used
after #15693.

Release Notes:

- N/A
2024-08-05 12:19:16 -04:00
Nate Butler
03cc18dd20
assistant-panel: Update model selector to a combo-box (#15693)
This updates the model selector to be a combobox (filterable list)

This PR causes the following regression: There is no longer a message in
the inline assistant explaining context is included from the assistant
panel. Will follow up with some sort of solution soon.

Before:
![CleanShot 2024-08-02 at 13 11
12@2x](https://github.com/user-attachments/assets/648ec4e3-48bc-4720-aaad-7659d848a4fa)

After:
![CleanShot 2024-08-02 at 13 10
37@2x](https://github.com/user-attachments/assets/09de098b-1a4a-44be-a6ae-6879f233d9a4)
![CleanShot 2024-08-02 at 13 10
48@2x](https://github.com/user-attachments/assets/701ce01c-3d6c-4c63-a6fc-53deff5d56c7)

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2024-08-05 11:52:07 -04:00
Marshall Bowers
f11f3f2599
collab: Attach GeoIP country code to RPC sessions (#15814)
This PR updates collab to attach the user's GeoIP country code to their
RPC session.

We source the country code from the
[`CF-IPCountry`](https://developers.cloudflare.com/fundamentals/reference/http-request-headers/#cf-ipcountry)
header.

Release Notes:

- N/A
2024-08-05 11:11:49 -04:00
Bennet Bo Fenner
be0ccf47ee
assistant: Show error messages in popover notification (#15808)
<img width="644" alt="image"
src="https://github.com/user-attachments/assets/ee6f2e60-e50a-481e-98b4-6c4b72a9b882">


Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-08-05 17:11:42 +02:00
Thorsten Ball
294892c470
assist panel: Update Zed AI notice if provider changes (#15805)
Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-05 15:36:08 +02:00
Thorsten Ball
49d0672cdd
assistant panel: Fix wrong state for Zed.dev provider being shown (#15800)
Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-05 15:35:58 +02:00
Thorsten Ball
0d97b236e7
assistant panel: Make "Configure" button in menu open Configuration view (#15799)
Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-05 13:31:03 +02:00
Thorsten Ball
0fba36469b
assistant panel: Show Zed AI notice & configuration hint (#15798)
This adds two possible notices to the assistant panel:

- Shows notice if currently selected provider is not configured
- Shows notice if user is signed-out and (does not have provider OR
provider is zed.dev) and tells user to sign in

Design needs to be tweaked. cc @iamnbutler 

![screenshot-2024-08-05-13 11
21@2x](https://github.com/user-attachments/assets/ada2d881-2f81-49ed-bebf-2efbf06e7d82)


Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-05 13:21:16 +02:00
Bennet Bo Fenner
d9977718d2
assistant: Fix prompts not being editable (#15796)
Fixes a bug introduced in #15615, where prompts could not be edited in
the prompt library.
This PR fixes the behavior by only preventing users to edit built-in
prompts.

Release Notes:

- N/A
2024-08-05 12:52:58 +02:00
apricotbucket28
559ce87b4e
linux: Save opened workspace when closing last window (#15754)
Fixes https://github.com/zed-industries/zed/issues/15642
(also fixes a bug where replacing a workspace in the same window would
reopen the old project after closing with `CTRL + Q`)

Release Notes:

- Linux: Fixed last workspace not being restored on startup
([#15642](https://github.com/zed-industries/zed/issues/15642)).
- Fixed a bug where a closed workspace could be reopened on startup.
2024-08-05 09:54:02 +02:00
Antonio Scandurra
0ec29d6866
Restructure workflow step resolution and fix inserting newlines (#15720)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-08-05 09:18:06 +02:00
Reese is on Codeberg
49e736d8ef
ruby: Recognize Steepfiles as Ruby (#15762)
Release Notes:

- N/A
2024-08-04 11:57:34 -04:00
Kyle Kelley
f8234aec6a
repl: Add ctrl-alt-enter binding to run in place (#15743)
Release Notes:

- Added `ctrl-alt-enter` keybinding for `repl::RunInPlace`
(`ctrl-option-enter` on MacOS). Keeps your screen position and cursor in
place when running any block.
2024-08-03 10:27:05 -07:00
Kyle Kelley
b7eae7fbd9
repl: Render markdown output from kernels (#15742)
<img width="1268" alt="image"
src="https://github.com/user-attachments/assets/73e03a28-f5e3-4395-a58c-cabd07f57889">

Release Notes:

- Added markdown rendering for Jupyter/REPL outputs. Push Markdown from
Deno/Typescript with `Deno.jupyter.md` and in IPython use
`IPython.display.Markdown`.
2024-08-03 09:41:12 -07:00
Kyle Kelley
36b61a8b87
repl: Process display IDs for updatable displays (#15738)
Release Notes:

- Added `update_display_data` support for REPL.


https://github.com/user-attachments/assets/d618e457-e314-482e-954a-6384f185629a
2024-08-03 08:15:36 -07:00
Adam Johnson
68446d2ed1
Use lowercase command names in initial settings files (#15717)
Release Notes:

- N/A

Making these two comments match what I see in the command palette:

<img width="629" alt="Xnapper-2024-08-03-08 09 26"
src="https://github.com/user-attachments/assets/f3eab05b-1560-4b0a-8df2-0eaf5746e422">
2024-08-03 09:35:09 -04:00
Kyle Kelley
4528e9d582
repl: Create better terminal output for REPL stdio (#15715)
Rely on our implementation of a GPUI powered alacritty terminal to
render stdout & stderr from the repl.

Release Notes:

- Fixed ANSI escape code and carriage return handling in repl outputs
(https://github.com/zed-industries/zed/issues/15640,
https://github.com/zed-industries/zed/issues/14855)


https://github.com/user-attachments/assets/bd3f1584-863a-4afa-b60b-9d222a830ff8

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-08-03 05:48:16 -07:00
Kyle Kelley
b6a3556a32
repl: Rely on block decorations to size according to content (#15713)
We no longer have to use line height calculations now that
https://github.com/zed-industries/zed/pull/15536 is in. Blocks resize
according to their content. This fixes up some of the rendering issues
on plaintext outputs as well.

Release Notes:

- Fix repl plain text output wrapping around and covering editor text
(https://github.com/zed-industries/zed/issues/15491,
https://github.com/zed-industries/zed/issues/14855)
2024-08-02 19:15:15 -07:00
Marshall Bowers
5c54596027
theme: Use a non-transparent color for the fallback title_bar.inactive_background (#15709)
This PR changes the fallback color for the
`title_bar.inactive_background` theme property so that the title bar
doesn't just disappear when a theme doesn't have a value set.

You're welcome, @naomieow.

Release Notes:

- linux: Changed the fallback color of `title_bar.inactive_background`
to a non-transparent value.
2024-08-02 18:44:22 -04:00
Marshall Bowers
91bbf0efc4
assistant: Normalize line endings for prompts loaded from the prompt library (#15708)
This PR makes it so we normalize the line endings for prompts to LFs
(`\n`) when we load a prompt from the library.

In some cases, prompts could end up with CRLF (`\r\n`) line endings.
When these prompts were used with the `/prompt` slash command and
summarily run, the prompt text would be converted into a rope, causing
the line endings to be normalized to LFs.

However, this would happen _after_ the ranges for the
`SlashCommandOutputSection`s were computed based on the text that still
contained the CRLFs. This would then cause these ranges to be invalid
for the text with the normalized endings, resulting in a panic when
converting them to anchors.

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

Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2024-08-02 18:13:17 -04:00
Marshall Bowers
3755f0d901
docs: Fix links to "Backend dependencies" setup (#15706)
This PR fixes the links to the "Backend dependencies" section from the
local collaboration docs.

We now provide links to the section in the platform-specific development
docs.

Release Notes:

- N/A
2024-08-02 16:47:45 -04:00
Marshall Bowers
c6580da889
assistant: Don't unwrap built-in step resolution prompt (#15704)
This PR removes some `unwrap`s while loading the built-in step
resolution prompt.

While these `unwrap`s are safe today, they are relying on some implicit
contracts that might change in the future. We're using this in a context
where it's easy to propagate an error upwards, so we may as well avoid
the `unwrap`s entirely and use a `Result`.

Release Notes:

- N/A
2024-08-02 16:07:43 -04:00
Danilo Leal
24afe7c3f9
Change the terminal assistant settings icon (#15702)
Change the terminal assistant settings icon so its consistent with the one we're using on the inline assistant.

--- 

Release Notes:

- N/A
2024-08-02 16:52:00 -03:00
Marshall Bowers
d6e558e3c9
copilot: Colocate copilot_chat_config_path with the rest of the Copilot code (#15703)
This PR moves the `copilot_chat_config_path` out of `paths` and into
`copilot` with the rest of the Copilot code.

Since this doesn't actually return a Zed path, it doesn't belong in
`paths`.

Release Notes:

- N/A
2024-08-02 15:46:06 -04:00
Piotr Osiewicz
e2eb68abca
chore: Remove leftover code from #15646 (#15697)
Release Notes:

- N/A
2024-08-02 20:08:57 +02:00
Piotr Osiewicz
ad11d83724
Skip over folded regions when iterating over multibuffer chunks (#15646)
This commit weaves through new APIs for language::BufferChunks, multi_buffer::MultiBufferChunks and inlay_map::InlayChunks that allow seeking with an upper-bound. This allows us to omit doing syntax highligting and looking up diagnostics for folded ranges. This in turn directly improves performance of assistant panel with large contexts.

Release Notes:

- Fixed poor performance when editing in the assistant panel after
inserting large files using slash commands

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-08-02 19:51:26 +02:00
Thorsten Ball
390815dd76
assistant panel: Tab-less configuration view (#15682)
TODOs for follow-up:
- [ ] When opening panel: nudge user to sign in if they're not signed-in
and have no provider configured (or if they're not signed-in and have
Zed AI configured)
- [ ] Configuration page is not scrollable
- [ ] Design tweaks

Current status:



https://github.com/user-attachments/assets/d26d65ea-43e8-481b-81a3-b3cba01704a8


Release Notes:

- N/A
2024-08-02 17:16:18 +02:00
Joseph T Lyons
35a3b00255 Add link to docs for configuring ruff 2024-08-02 11:06:01 -04:00
Egor Kotov
69cefb3a0c
docs: Add brief R/Ark instructions (#15357)
Added brief instructions for [`Ark`](https://github.com/posit-dev/ark)
kernel for `R`.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-02 10:22:45 -04:00
Vladimir Kukushkin
55fbafee35
docs: Fix Ruff-related links (#15511)
Release Notes:

- N/A
2024-08-02 10:16:13 -04:00
Mayank Jikadara
61365e034f
Relax "test" runnable check (#15647)
This commit updates the Tree-sitter query to match Rust attributes
containing the word "test". The previous query only matched attributes
with the exact string "test", which was too restrictive for custom test
macros like https://docs.rs/test-log/0.2.10/test_log/#

Discussion - https://github.com/zed-industries/zed/discussions/15580
2024-08-02 15:22:01 +02:00
Antonio Scandurra
b88b9dcdd1
Extend symbol ranges by their annotation range when suggesting edits (#15677)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-08-02 11:40:29 +02:00
Thorsten Ball
e4608e7f12
assistant panel: Intermediate fix for focus problems (#15674)
This is an intermediate fix for the focus problems in the assistant
panel. Intermediate because I'm going to shred the whole
ConfigurationView now and replace the tabs inside with a list.


Release Notes:

- N/A
2024-08-02 11:05:30 +02:00
Nate Butler
b4dcd6d394
Update model selector (#15665)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-01 21:57:51 -04:00
Marshall Bowers
5e011ab029
language_model: Denote the availability of language models (#15660)
This PR updates the `LanguageModel` trait with a new method for denoting
the availability of a model.

Right now we have two variants:

- `Public` for models that have no additional restrictions (other than
their respective setup/authentication requirements)
- `RequiresPlan` for models that require a specific Zed plan

Release Notes:

- N/A
2024-08-01 18:26:27 -04:00
Marshall Bowers
906d9736d5
gleam: Update Tree-sitter grammar for label shorthand syntax (#15659)
This PR updates the Gleam Tree-sitter grammar to support label shorthand
syntax.

Release Notes:

- N/A
2024-08-01 17:46:23 -04:00
Marshall Bowers
771424e4f9
extension: Make worktree argument to run_slash_command optional (#15658)
This PR updates the extension API to make the `worktree` argument to
`run_slash_command` optional.

We may not always have a worktree, and not all slash commands need them,
so by making it optional we can allow individual slash commands to
decide what to do when there is no worktree.

Release Notes:

- N/A
2024-08-01 17:34:44 -04:00
Marshall Bowers
88f29c8355
assistant: Don't require a worktree to run slash commands (#15655)
This PR fixes an issue where slash commands were not able to run when
Zed did not have any worktrees opened.

This requirement was only necessary for slash commands originating from
extensions, and we can enforce the presence of a worktree just for
those:

<img width="378" alt="Screenshot 2024-08-01 at 5 01 58 PM"
src="https://github.com/user-attachments/assets/38bea947-e33b-4c64-853c-c1f36c63d779">

Release Notes:

- N/A
2024-08-01 17:14:13 -04:00
Bilal Elmoussaoui
55fc1f0afb
docs: Remove wrongly documented secrets portals (#15303)
- The secrets portal is only used if the application is sandboxed
without access to the org.freedesktop.secrets on the host but as zed is
not really working correctly if sandboxed as is, it is better to
completely omit that part
- The org.freedestkop.secrets is not a portal but a spec file that is
implemented by both gnome in gnome-keyring, kde in kwallet but also by
other password managers like keepassxc and it is a requirement for a
"correctly" set up linux desktop so just remove that wrongly documented
bit

Release Notes:

- N/A
2024-08-01 17:07:26 -04:00
Antonio Scandurra
1fa4cc3c7a Use the right max_token_count for Qwen
Co-Authored-By: Nathan <nathan@zed.dev>
2024-08-01 22:42:10 +02:00
Nathan Sobo
1b85793ebc
Fix inline assist deletion blocks (#15651)
After the changes in #15536, block decorations need to be given an
explicit height if their content doesn't consume height on its own. We
missed that inline transformation deletion decorations didn't do this,
creating weird results. This fixes the issue and prevents block
decorations from ever having a zero height. That helps avoid major
weirdness, but this still a bit of a gotcha.

We need to back port this to Preview Channel (0.147.x)

Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-08-01 22:41:25 +02:00
Marshall Bowers
0799dfb2b8
assistant: Only insert the host's default prompt when creating a new context (#15650)
This PR fixes an issue where creating a new context as a guest would
insert multiple default prompts: one for the host and one for the guest.

When creating a new context as a guest while collaborating, we should
only use the host's default prompt.

Release Notes:

- N/A
2024-08-01 16:28:45 -04:00
Antonio Scandurra
21816d1ff5
Add Qwen2-7B to the list of zed.dev models (#15649)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-08-01 22:26:07 +02:00
Marshall Bowers
60127f2a8d
Fix .env.toml paths (#15645)
This PR fixes the `.env.toml` paths, since we inadvertently broke them
in https://github.com/zed-industries/zed/pull/15557.

There's likely a better way we can do this, but I wanted to restore the
previous behavior, for now.

Release Notes:

- N/A
2024-08-01 15:43:29 -04:00