Commit Graph

16538 Commits

Author SHA1 Message Date
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
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
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
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
Marshall Bowers
4bfb8fda8d
Rename zed.dev/settings to zed.dev/account (#15636)
This PR renames the links to the `zed.dev/settings` page to the
`zed.dev/account`.

Some of these spots will likely link out to a marketing page later.

Release Notes:

- N/A
2024-08-01 13:59:21 -04:00
Marshall Bowers
7652045903
Remove primary/secondary distinction for CachedLspAdapter (#15634)
This PR removes the primary/secondary distinction for
`CachedLspAdapter`s.

After #15624 we weren't relying on the `is_primary` field anywhere, so
we can remove it.

Release Notes:

- N/A
2024-08-01 13:51:34 -04:00
Thorsten Ball
5afa799f37
assistant panel: Add button to open new context to configuration page (#15628)
This adds a button to the `Configuration` page for providers so it's
easy to start a new context _with the given provider_ selected.

![screenshot-2024-08-01-17 53
07@2x](https://github.com/user-attachments/assets/f25ecbe0-0b96-4a32-ac98-a5113b08ec2a)

Obviously not the most beautiful form this button can have, but works!

cc @iamnbutler 

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-01 19:33:00 +02:00
Nate Butler
70b2da78f8
Update assistant config UI (#15630)
![CleanShot 2024-08-01 at 12 55
01@2x](https://github.com/user-attachments/assets/f9ed44ba-6bff-4805-ad71-2e3538315e57)

- Remove assisstant_description for now.
- Updates assistant config UI
- Updates Ollama and zed.dev provider UIs
- Updates download icon

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-01 13:30:35 -04:00
Marshall Bowers
3bd9a3f478
Respect the language_servers setting's order when determining the primary language server (#15624)
This PR updates how we determine the "primary" language server for a
buffer to make it respect the order specified by the `language_servers`
setting.

Previously we were relying on the language servers to be registered in
the right order in order to select the primary one effectively.

However, in my testing I observed some cases where a native language
server (e.g., `tailwindcss-language-server`) could end up first in the
list of language servers despite not being first in the
`language_servers` setting.

While this wasn't a problem for the Tailwind or ESLint language servers
on account of them being defined natively with the designation of
"secondary" language servers, this could cause problems with
extension-based language servers.

To remedy this, every time we start up language servers we reorder the
list of language servers for a given language to reflect the order in
the `language_servers` setting. This ordering then allows us to treat
the first language server in the list as the "primary" one.

Related issues:

- https://github.com/zed-industries/zed/issues/15023
- https://github.com/zed-industries/zed/issues/15279

Release Notes:

- The ordering of language servers will now respect the order in the
`language_servers` setting.
- The first language server in this list will be used as the primary
language server.
2024-08-01 11:58:23 -04:00
Antonio Scandurra
0b175ac66e
Give edit steps multibuffer a title (#15625)
Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-08-01 17:48:56 +02:00
Thorsten Ball
ed7952f5ef
assistant panel: Update active tab in config panel when provider changes (#15621)
Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-01 17:24:55 +02:00
Thorsten Ball
6c83c7906a
assistant panel: Ensure always active tab is shown (#15618)
Small bug that snuck in with #15490. When closing the configuration tab
explicitly and then activating the assistant tab again, it wouldn't show
the configuration page.

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-01 16:14:31 +02:00
Piotr Osiewicz
ac1a15f5d7
assistant: Report all worktree entries in /file completions (#15617)
We were reporting file count as worktree entry count, which led to us
missing some of the entries in /file command completion.

/cc @bennetbo

The other components that used `PathMatchCandidateSet` are
`/diagnostics` and file finder. File finder is unaffected, as it used
`Candidates::Files` - thus previously reported count was correct for it;
`/diagnostics` were using `::Entries` as well, so it could miss entries
just like `/files`.

Release Notes:

- Fixed /file and /diagnostics slash commands omitting entries in it's
completions menu.
2024-08-01 16:09:53 +02:00
Nathan Sobo
a9c6e435f7
Bundle editing workflow prompt as a read-only built-in prompt (#15615)
Built-in prompts can still be removed from the default prompt, but they
can't be edited and are automatically updated with new Zed releases.

Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-08-01 15:56:17 +02:00
Bennet Bo Fenner
be3a8584ff
assistant: Add a Configuration page (#15490)
- [x] bug: setting a key doesn't update anything
- [x] show high-level text on configuration page to explain what it is
- [x] show "everything okay!" status when credentials are set
- [x] maybe: add "verify" button to check credentials
- [x] open configuration page when opening panel for first time and
nothing is configured
- [x] BUG: need to fix empty assistant panel if provider is `zed.dev`
but not logged in


Co-Authored-By: Thorsten <thorsten@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-08-01 15:54:47 +02:00
Piotr Osiewicz
79213637e2
assistant: Display hamburger menu even when the panel is not focused (#15612)
This commit gives tab button renderers control over the condition in
which they should be displayed. Previously we displayed tab buttons only
when the pane was focused. Now tab renderers can return an Option of
AnyElement, which in turn makes it possible for them to control when and
how they're rendered. Pane and Terminal handlers still check for self
focus condition and Assistant Panel does not.



Release Notes:

- N/A
2024-08-01 15:08:48 +02:00
Antonio Scandurra
dc0f7436e0
Add support for backwards compatibility in PromptStore (#15602)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-08-01 15:07:14 +02:00
Ramkumar
04065d9a6a
Fix GitHub Copilot chat authentication on Windows (#15587)
This PR fixes Copilot chat authentication on Windows. GitHub Copilot
chat in assistant panel uses auth token file generated by [copilot
language server](https://github.com/zed-industries/copilot). The path to
authentication token file is platform dependent. On Windows, it happens
to be `~\AppData\Local\github-copilot\hosts.json`.

Release Notes:

- Fixed Copilot chat sign in issue on Windows ([#4673](https://github.com/zed-industries/zed/issues/4673))
2024-08-01 14:06:13 +03:00
Antonio Scandurra
1246010e44
Fix padding for end_hover_slot on ListItems (#15598)
Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-08-01 12:10:45 +02:00
Kirill Bulatov
c98918aed8
Properly calculate y offsets for multi buffer context menus (#15594)
Follow-up of https://github.com/zed-industries/zed/pull/14727

Release Notes:

- Fixed multi buffer context menus not showing properly

Co-authored-by: Max Brunsfeld <max@zed.dev>
2024-08-01 12:35:46 +03:00
Marshall Bowers
218776a119
collab: Increase the frequency at which we poll for Stripe events (#15577)
This PR increases the frequency at which we poll for Stripe events.

This decreases the amount of time we have to wait in order for changes
in Stripe to be reflected in our system.

We now poll for events every 5 seconds, down from every 5 minutes.

In order to avoid needlessly over-fetching data from Stripe, we put a
cap on the number of pages consisting entirely of already-processed
events that we can see before stopping. This is set to 4, so once we've
seen 4 pages of processed events (400 events in total), we'll stop
fetching subsequent pages.

Release Notes:

- N/A
2024-07-31 19:33:41 -04:00
Danilo Leal
a6f73c10d1
Fix symlink icon in the project panel (#15537)
Closes https://github.com/zed-industries/zed/issues/15481

---

Release Notes:

- N/A
2024-07-31 18:58:07 -03:00
Danilo Leal
236e72df38
Fix editor & assistant panel toolbar height mismatch (#15552)
This PR ensures that the toolbar within the editor and the assistant
panel have the same height. I also pushed in some other tiny design
(spacing, really) tweaks. There's still a mismatch between the editor
toolbar and the assistant panel's history tab, but I'll try to tackle
this separately.

---

Release Notes:

- N/A
2024-07-31 18:57:55 -03:00
Marshall Bowers
0d9a6d246a
collab: Fix spelling of "cancellation" (#15569)
English is hard.

In US English the forms of "cancel" are as follows:

- `cancel`
- `cancels`
- `canceling`
- `canceled`
- `cancellation`

Note that `cancellation` _does_ use the double `l`, which all the rest
of the forms do not.

Release Notes:

- N/A
2024-07-31 17:36:26 -04:00
Marshall Bowers
2bc0a58f32
collab: Use the right zed.dev URL for the environment (#15566)
This PR updates collab to pick the `zed.dev` URL based on the current
environment rather than always using `https://zed.dev`.

This means that when developing locally we'll use
`http://localhost:3000` to be taken to the locally-running version of
`zed.dev`.

Release Notes:

- N/A
2024-07-31 17:08:29 -04:00
Max Brunsfeld
1b2d4ee132
Allow users to stop a previously scheduled cancelation of their Zed Pro plan (#15562)
Release Notes:

- N/A

Co-authored-by: Marshall <marshall@zed.dev>
2024-07-31 16:36:46 -04:00
Max Brunsfeld
3f1c091b87
Add the ability to store secret dev-only env vars in .env.secret.toml (#15557)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-07-31 12:41:09 -07:00
Max Brunsfeld
9751e61101
Show rate limit notices (#15515)
This UI change is behind a `ZedPro` feature flag so that it won't be
visible until we're ready to launch that service.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
2024-07-31 12:05:19 -07:00
Marshall Bowers
8c54a46202
collab: Adapt rate limits based on plan (#15548)
This PR updates the rate limits to adapt based on the user's current
plan.

For the free plan rate limits I just took one-tenth of the existing rate
limits (which are now the Pro limits). We can adjust, as needed.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-07-31 14:27:28 -04:00
Piotr Osiewicz
7a0149f17c
multi_buffer: Reuse buffer chunks iterator when seeking across folds within an excerpt (#15532)
Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-07-31 10:29:15 -07:00
Joseph T Lyons
7259d092a7 v0.148.x dev 2024-07-31 12:17:58 -04:00
Antonio Scandurra
fef95110bb
If paths from edit steps omit worktree root, search worktrees for relative path (#15543)
Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-31 17:55:11 +02:00
Remco Smits
3c404dec92
Send pane removeItem event before removing the item (#15541)
This PR renames and added a new pane event to indicate the difference
between `removing` and `removed` event. This change is needed for the
debugger implementation, if you close a pane we have to send a
`terminateThread` request to the adapter because it's not supported to
reopen a pane. So when the pane is removing we have to know what thread
it is what is stored on the panel itself, so we have to be able to get
this information before the pane is actually removed.

So my idea how to fix this was by adding a new event called
`RemovedItem` which is a rename of `RemoveItem` which also makes a bit
more sense because the item is removed at that point. And seeing the
name `RemoveItem` does not really say that it's removed, more like we
are removing the item.

/cc @mikayla-maki

Release Notes:

- N/A
2024-07-31 08:48:19 -07:00
Antonio Scandurra
5b1ea7eda0
Clean up inline assist editor rendering (#15536)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Max <max@zed.dev>
2024-07-31 17:43:08 +02:00
Thorsten Ball
874fedd717
assistant panel: Fix panic when opening panel with zed.dev provider (#15538)
There was/is some race condition that gets triggered only with the
zed.dev provider when opening the provider that would cause a
double-borrow on workspace.

This PR fixes the issue by cloning the workspace weakly. Turns out we
can go very far with just the weak reference.

We're still a bit unsure why exactly the race condition happened, since
it's hard to reproduce, but we're working on configuration
view/management in #15490 anyway.

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-07-31 16:57:24 +02:00
Peter Tripp
64bfec533e
Revert terminal: Add Alt key bindings for terminal (#15535)
- reverts commit 66ada3e44c.
- change default `option_as_meta` to true
2024-07-31 10:54:58 -04:00