Commit Graph

16990 Commits

Author SHA1 Message Date
Thorsten Ball
8ec680cecb
project search: Increase perf up to 10x by batching git status calls (#16936)
***Update**: after rebasing on top of
https://github.com/zed-industries/zed/pull/16915/ (that also changed how
search worked), the results are still good, but not 10x. Instead of
going from 10s to 500ms, it goes from 10s to 3s.*

This improves the performance of project-wide search by an order of
magnitude.

After digging in, @as-cii and I found that opening buffers was the
bottleneck for project-wide search (since Zed opens, parses, ... buffers
when finding them, which is something VS Code doesn't do, for example).
So this PR improves the performance of opening multiple buffers at once.

It does this by doing two things:

- It batches scan-requests in the worktree. When we search, we search
files in chunks of 64. Previously we'd handle all 64 scan requests
separately. The new code checks if the scan requests can be batched and
if so it, it does that.
- It batches `git status` calls when reloading the project entries for
the opened buffers. Instead of calling `git status` for each file, it
calls `git status` for a batch of files, and then extracts the status
for each file.

(It has to be said that I think the slow performance on `main` has been
a regression introduced over the last few months with the changes made
to project/worktree/git. I don't think it was this slow ~5 months ago.
But I also don't think it was this fast ~5 months ago.)

## Benchmarks

| Search | Before | After (without
https://github.com/zed-industries/zed/pull/16915) | After (with
https://github.com/zed-industries/zed/pull/16915)
|--------|--------|-------|------|
| `zed.dev` at `2b2a501192e78e`, searching for `<` (`4484` results) |
3.0s<br>2.9s<br>2.89s | 489ms<br>517ms<br>476ms | n/a |
| `zed.dev` at `2b2a501192e78e`, searching for `:` (`25886+` results) |
3.9s<br>3.9s<br>3.8s | 70ms<br>66ms<br>72ms | n/a |
| `zed` at `55dda0e6af`, searching for `<` (`10937+` results) |
10s<br>11s<br>12s | 500m<br>499ms<br>543ms | 3.4s<br>3.1s<br> |

(All results recorded after doing a warm-up run that would start
language servers etc.)

Release Notes:

- Performance of project-wide search has been improved by up to 10x.

---------

Co-authored-by: Antonio <antonio@zed.dev>
2024-08-27 11:59:59 +02:00
Conrad Irwin
88d36d8b9f
Restore missing fifo check (#16931)
Fixes a merge conflict between #16915 and #16039

Release Notes:

- N/A
2024-08-26 21:17:44 -06:00
0x2CA
9662829810
vim: Add Smart Relative Line Number (#16567)
Closes #16514

Release Notes:

- Added Vim: absolute numbering in any mode except `insert` mode

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-08-26 21:17:21 -06:00
Kyle Kelley
26d943287b
REPL: Refactor output (#16927)
Shuffle `outputs.rs` into individual `outputs/*.rs` files and start
documenting them more.

Release Notes:

- N/A
2024-08-26 18:03:06 -07:00
Max Brunsfeld
bea6786f14
Fix git repository state corruption when work dir's metadata is updated (#16926)
Fixes https://github.com/zed-industries/zed/issues/13176

Release Notes:

- Fixed an issue where git state would stop updating if the root
directory of a git repository was updated in certain ways
2024-08-26 17:46:50 -07:00
moshyfawn
2de420a67b
assistant: Fix model selector check icon overflow (#16716)
Release Notes:

- Fixed assistant model selector check icon overflow for long model
names
2024-08-26 17:32:32 -07:00
Kirill Bulatov
f64f85eb1e
Do not hold any tasks by default and no other terminals (#16847) 2024-08-27 01:48:34 +03:00
apricotbucket28
29745ae229
blade: Align rasterized path bounds to whole pixels (#16784)
Related: https://github.com/zed-industries/zed/pull/15822

| Before | After |
| --- | --- |
|
![image](https://github.com/user-attachments/assets/4c4ed1e7-b639-44ce-b318-8cdaaee809ee)|
![image](https://github.com/user-attachments/assets/c2757528-eef3-4d21-9522-39b2597a96b7)
|
|
![image](https://github.com/user-attachments/assets/b70ee108-bea6-4e5e-9583-392d1163d236)
|
![image](https://github.com/user-attachments/assets/aefc1f0c-7bba-4287-a3f9-bbb9befb6a4c)
|

Release Notes:

- N/A
2024-08-27 01:26:59 +03:00
Stanislav Alekseev
6afb36fd6f
Reorganize the context menu a bit (#16773)
Follow up to #16080 
The idea is that the current context menu became a bit top-heavy over
time. Let's reorganisze it into four sections:
1. Finding symbols
2. Editing using lsp and similar
3. Copy/Cut/Paste
4. Getting file location

Release Notes:

- Reorganized context menu to be a bit less top heavy and have more
logical parts

Before (a giant part on top and two small ones on the bottom):
<img width="248" alt="Screenshot 2024-08-23 at 21 02 33"
src="https://github.com/user-attachments/assets/87a136c7-df16-4032-ba02-dea087fd8445">

After (much more balanced):
<img width="250" alt="Screenshot 2024-08-23 at 21 01 28"
src="https://github.com/user-attachments/assets/4aa48b8a-99f3-4315-b325-625a47ecd5b8">
2024-08-27 01:22:58 +03:00
Toni Cárdenas
b99bf92452
Implement "join pane into next" (#16077)
Closes #12409

Release Notes:

- Added "join pane into next" action ([#12409](https://github.com/zed-industries/zed/issues/12409))


https://github.com/zed-industries/zed/assets/727422/00cc8599-e5d6-4fb8-9f0d-9b232d2210ef

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-08-27 00:51:51 +03:00
Max Brunsfeld
f417893a7b
Avoid unwrap of Worktree::root_entry in resolve_path_in_worktrees (#16917)
It looks like this unwrap was introduced in
https://github.com/zed-industries/zed/pull/16534.

I think a worktree's `root_entry` can be null if it represents a
non-existent file that has not yet been saved. I hit a panic due to the
`unwrap` a couple of times on nightly.

Release Notes:

- N/A
2024-08-26 14:01:56 -07:00
Conrad Irwin
ef22372f0b
SSH remote search (#16915)
Co-Authored-By: Max <max@zed.dev>

Release Notes:

- ssh remoting: add project search

---------

Co-authored-by: Max <max@zed.dev>
2024-08-26 14:47:02 -06:00
Peter Tripp
0332eaf797
Remove reference to Copilot plugin (#16916) 2024-08-26 16:43:22 -04:00
Peter Tripp
c2835df898
Improve buffers used by Zed for discoverability/visibility (#16906)
- Fixed Telemetry log being marked dirty.
- Fixed asset buffers (default settings and default keymap) showing 'untitled' in breadcrumbs
2024-08-26 16:42:35 -04:00
Marshall Bowers
93a7682659
collab: Count active users based on the tokens per minute measure (#16911)
This PR fixes an issue where active user counts were being computed
across _all_ measures instead of the per-minute measures.

We now compute them using the tokens per minute measure, as we're
concerned with usage in recent minutes.

Release Notes:

- N/A
2024-08-26 15:04:55 -04:00
Scott Lembcke
e2635a685e
Add command to copy current file:line for working with external tools (#14793)
Closes #14787.

I made a quick draft implementation of this feature request:
https://github.com/zed-industries/zed/issues/14787

I know how to use use gdb well, so lacking a built-in debugger is OK.
BUT... Speaking personally, setting breakpoints is 50% of what I want an
IDE to do for me when debugging. Having a feature where I can click,
copy, "b [paste]", is a huge step up from typing the whole thing in
manually. I figure this must be useful for other external tools, or even
just regular-human-communication too.

Open Questions:
* Does this belong in the right click menu? (I put it next to "Copy
Permalink" which is similar.)
* Probably not useful enough to get a default keymap?
* Relative vs absolute path?
* Does this need tests?

Release Notes:

- Added `editor: copy file location` command to copy the current file
location (FILE:LINE) to the clipboard
([#14787](https://github.com/zed-industries/zed/issues/14787)).

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-26 14:31:20 -04:00
TheCub3
2f08a0a28c
Fix fifo files hanging the project wide search (#16039)
Release Notes:

- Fixed the issue related to the project wide search being stuck when
project contains .fifo files
- Might potentially solve the following issue
https://github.com/zed-industries/zed/issues/7360
2024-08-26 10:40:20 -06:00
Piotr Osiewicz
aaddb73b28
assistant: Refesh message headers only for dirty messages (#16881)
We've noticed performance issues in long conversations with assistants;
the profiles pointed to slowiness in WrapMap (and indeed there were some
low hanging fruits that we picked up in
https://github.com/zed-industries/zed/pull/16761). That however did not
fully resolve the issue, as WrapMap still cracked through in profiles;
basically, the speedup I've landed has just moved the post elsewhere.

The higher level issue is that we were trying to refresh message headers
for all messages, irrespective of whether they've actually needed to be
updated. This PR fixes that by using `replace_blocks` API where
possible.

Release Notes:

- Improved performance of Assistant Panel with long conversations.
2024-08-26 18:16:23 +02:00
Thorsten Ball
afe4d8c8cc
yaml: Add single quotes to list of brackets (#16859)
Closes #16854

Release Notes:

- Single quotes are now auto-closable in YAML files
2024-08-26 18:02:40 +02:00
Nate Butler
7a964ff91a
Don't rely on relative path for docs preprocessor (#16883)
Reapplies #16700 with a corrected command. Now it no longer relies on a
relative path.

Thanks @maxdeviant for the quick help 🙏 

Release Notes:

- N/A
2024-08-26 11:43:13 -04:00
Berkus Decker
d67d44f600
extension: Add more logging when building extensions (#16794)
This helps debug what steps are taken and where
the compiled extension ended up.

Also remove duplicate "compiling Rust extension" / "compiling rust
extension" text - it's confusing.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-26 11:18:06 -04:00
Peter Tripp
7936fe40ae
ollama: Support model context_size (num_ctx) >2048 (#16877) 2024-08-26 11:09:47 -04:00
Nate Butler
2a03dde538
Revert "Add docs_preprocessor crate to support Zed Docs" (#16880)
Temporarily revert #16700 to deal with this error:

`error: manifest path `../crates/docs_preprocessor/Cargo.toml` does not
exist` as it was causing the docs-preprocessor not to run, meaning
unexpanded templates were showing up in the public docs.

Reverts zed-industries/zed#16700

Release Notes:

- N/A
2024-08-26 11:06:25 -04:00
Nate Butler
46bb04a019
Add docs_preprocessor crate to support Zed Docs (#16700)
This PR adds a mdbook preprocessor for supporting Zed's docs.

This initial version adds the following custom commands:

**Keybinding** 

`{#kb prefix::action_name}` (e.g. `{#kb zed::OpenSettings}`)

Outputs a keybinding template like `<kbd
class="keybinding">{macos_keybinding}|{linux_keybinding}</kbd>`. This
template is processed on the client side through `mdbook` to show the
correct keybinding for the user's platform.

**Action** 

`{#action prefix::action_name}` (e.g. `{#action zed::OpenSettings}`)

For now, simply outputs the action name in a readable manner. (e.g.
zed::OpenSettings -> zed: open settings)

In the future we'll add additional modes for this template, like create
a standard way to render `{action} ({keybinding})`.

## Example Usage

```
To open the assistant panel, toggle the right dock by using the {#action workspace::ToggleRightDock} action in the command palette or by using the
{#kb workspace::ToggleRightDock} shortcut.
```

Release Notes:

- N/A
2024-08-26 10:50:40 -04:00
张小白
5ee4c036f9
assistant: Normalize line endings for prompts loaded from templates (#16808)
Closes #16804

Similar to #15708, when reading prompts from a template, both Windows
and Linux might end up with `CRLF (\r\n)` line endings, which can result
in a panic.

Release Notes:

- N/A
2024-08-26 10:34:20 -04:00
apricotbucket28
a28700a74d
theme: Fallback to opaque color for title_bar.inactive_background (#16833)
Fixes https://github.com/zed-industries/zed/issues/16699, fixes
https://github.com/zed-industries/zed/issues/15112, fixes
https://github.com/zed-industries/zed/issues/14955

| Before | After |
|--------|--------|
|
![image](https://github.com/user-attachments/assets/3c93dc02-3421-4fd8-b34e-c54644202caa)
|
![image](https://github.com/user-attachments/assets/f938d77f-7e9b-4c1f-9beb-38ff77a5fa93)
|

Release Notes:

- Linux: Fixed title bar becoming transparent when the window lost
focus.
2024-08-26 10:26:47 -04:00
Kirill Bulatov
55dda0e6af
A set of small fixes (#16849)
* Linux Clippy lints fixed
* Zed local tasks are now simpler to rerun
* Zed's `release-fast` build profile keeps the debug info so it's
possible to properly debug things without altering the sources

Release Notes:

- N/A
2024-08-26 02:24:08 +03:00
Kirill Bulatov
1a2a538366
Improve Linux terminal keymap and context menu (#16845)
Follow-up https://github.com/zed-industries/zed/pull/16085 that fixes
the search deploy to be actually a part of the terminal-related
bindings.

Part of https://github.com/zed-industries/zed/issues/16839

Also 

* fixes few other bindings to use `shift` and avoid conflicts with the
existing key bindings.
* adds terminal inline assist to the context menu and makes both the
menu and the button to dynamically adjust to `assist.enabled` settings
change

It is still unclear to me, why certain labels for certain bindings are
wrong (it's still showing `ctrl-w` for closing the terminal tab, and
`shift-insert` instead of `ctrl-shift-v` for Paste, while Insert is near
and has a `ctrl-shift-c` binding shown) but at least the keys work now.

Release notes: 
- Improved Linux terminal keymap and context menu
2024-08-26 01:01:46 +03:00
Kirill Bulatov
28271a9a36
Display buffer/project search entries in the outline panel (#16589)
Prototypes a way to display new entities in the outline panel, making it
less outline.
The design is not final and might be adjusted, but the workflow seems to
be solid enough to keep and iron it out.

* Now, when any project search buffer is activated (multi buffer mode),
or buffer search is open (singleton buffer mode, but is available for
search usages multi buffer too — in that case buffer search overrides
multi buffer's contents display), outline panel displays all search
matches instead of the outline items.

Outline items are not displayed at all during those cases, unless the
buffer search is closed, or a new buffer gets opened, of an active
buffer search matches zero items.


https://github.com/user-attachments/assets/4a3e4faa-7f75-4522-96bb-3761872c753a


* For the multi buffer mode, search matches are grouped under
directories and files, same as outline items

![Screenshot 2024-08-21 at 14 55
01](https://github.com/user-attachments/assets/6dac75e4-be4e-4338-917b-37a32c285b71)


* For buffer search , search matches are displayed one under another


![image](https://github.com/user-attachments/assets/9efcff85-d4c7-4462-9ef5-f76b08e59f20)


For both cases, the entire match line is taken and rendered, with the
hover tooltip showing the line number.
So far it does not look very bad, but I am certain there are bad cases
with long lines and bad indents where it looks not optimal — this part
most probably will be redesigned after some trial.
Or, maybe, it's ok to leave the current state if the horizontal
scrollbar is added?

Clicking the item navigates to the item's position in the editor.
Search item lines are also possible to filter with the outline panel's
filter input.

* Inline panel is now possible to "pin" to track a currently active
editor, to display outlines/search results for that editor even if
another item is activated afterwards:


![image](https://github.com/user-attachments/assets/75fb78c3-0e5f-47b4-ba3a-485c71d7e342)

This is useful in combination with project search results display: now
it's possible to leave the search results pinned in the outline panel
and jump to every search result and back.

If the item the panel was pinned to gets closed, the panel gets back to
its regular state, showing outlines/search results for a currently
active editor.


Release Notes:

- Added a way to display buffer/project search entries in the outline
panel
2024-08-25 21:40:02 +03:00
Piotr Osiewicz
5e55d5507f
language: Do not fetch diagnostics when iterating over text without language awareness (#16824)
This PR fixes a regression from
https://github.com/zed-industries/zed/pull/15646 where we've started
fetching diagnostic spans unconditionally (whereas previously that
wasn't done when iterating over raw text).

Closes #16764

Release Notes:

- Fixed performance regression in handling buffers with large quantities
of diagnostics.
2024-08-25 18:02:54 +02:00
Walter de Jong
14f8d3a33a
gpui: Send correct kill signal on Linux (#16797)
should be kill -0 (zero) instead

Related to #14291 and #14310

Release Notes:

- N/A
2024-08-24 22:11:06 +03:00
Marshall Bowers
340662e2f7
collab: Add lifetime spending limit for LLM usage (#16780)
This PR adds a lifetime spending limit on LLM usage.

Exceeding this limit will prevent further use of the Zed LLM provider.

Currently the cap is $1,000.

Release Notes:

- N/A
2024-08-23 16:41:16 -04:00
Affan Shahid
352c95cf0d
Add injections for GraphQL template literals and function calls (#16368)
This PR adds syntax highlighting support for `gql` and `graphql` tagged
literals. It also adds highlighting for `graphql()` and `gql()` function
calls, which are another common way to define queries.

Note: I am using the
[`graphql`](https://github.com/11bit/zed-extension-graphql) extension to
provide syntax highlighting

Before:
<img width="413" alt="image"
src="https://github.com/user-attachments/assets/114a98be-9790-4cdf-ba98-553f777ff08a">

After:
<img width="418" alt="image"
src="https://github.com/user-attachments/assets/98fc5dfd-d1a3-45c4-be8e-063cf68b6e6e">

Release Notes:

- Added syntax highlighting for `graphql` tagged template literals and
function calls in javascript, typescript and tsx languages.
2024-08-23 12:36:45 -06:00
Jason Lee
938d93a64c
gpui: Add truncate and text_ellipsis to TextStyle (#14850)
Release Notes:

- N/A

Ref issue #4996

## Demo

```
cargo run -p gpui --example text_wrapper 
```



https://github.com/user-attachments/assets/a7fcebf7-f287-4517-960d-76b12722a2d7

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-23 14:02:51 -04:00
Ihnat
12dda5fa1b
Add Format Buffer action to mouse context menu (#16080)
Closes #15891 

Release Notes:

- Added "Format Buffer" action to the right-click menu within a buffer.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-23 13:44:34 -04:00
Piotr Osiewicz
783cccf95d
WIP: Improve performance of Wrap Map (#16761)
We've ran into performance issues when reinserting new blocks into the
assistant panel; in profiles WrapMap showed up, as we try to query wrap
boundaries over and over, which is a hidden O(n^2) - for each block, we
may potentially look at all of the Wraps. This PR alleviates this issue
by storing away previously resolved wrap range; consecutive iterations
can often reuse it.
This should help with performance of Assistant Panel with long
conversations.

Release Notes:

- Improved performance of assistant panel with large # of text.
2024-08-23 18:59:30 +02:00
张小白
30a677e257
theme: Change autocomplete value for *_font_fallbacks (#16759)
This PR follows up #16466, changes the default value used when
autocompleting the `ui_font_fallbacks` and `ui_font_fallbacks` settings
from `null` to `[]`.

Special thanks to @maxdeviant for the guidance on writing better code!


Release Notes:

- N/A
2024-08-23 12:12:43 -04:00
Marshall Bowers
935cf542ae
Fix impersonation in local development (#16755)
This PR fixes impersonation in local development by fetching the user
from the GitHub API so we can get their `github_user_id`.

The `github_user_id` is now required after #16704.

Since this is just a development flow, we're fetching the user on the
client as opposed to making changes on the server.

This request uses the `GITHUB_TOKEN` environment variable for
authentication, if it exists, or will make an unauthenticated GitHub API
request.

Release Notes:

- N/A
2024-08-23 10:49:34 -04:00
Kevin Sweet
5e869dadf9
Fix ctrl-d/u issues with scroll_beyond_last_line off (#15395)
Closes #15356

Release Notes:

- vim: Fixed issues with `ctrl-d`/`ctrl-u` when
`scroll_beyond_last_line` is set to `off`
([#15356](https://github.com/zed-industries/zed/issues/15356)).


https://github.com/user-attachments/assets/d3166393-4a4e-4195-9db6-3ff1d4aeec78

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-23 08:34:40 -06:00
Piotr Osiewicz
518dd3ed3a
activity indicator: Do not show indicators background when there's no state (#16737)
Found by @SomeoneToIgnore :

![image](https://github.com/user-attachments/assets/3c8fd3f6-3411-4ca9-88b7-56a7d0d407d3)



Release Notes:

- N/A
2024-08-23 13:04:54 +02:00
Thorsten Ball
7647644602
zed ai: Show ToS form in Configuration View (#16736)
Related #16618

Release Notes:

- N/A
2024-08-23 11:17:21 +02:00
Piotr Osiewicz
119e337344
activity indicator: fix popover menu appearing for empty lists (#16734)
Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-08-23 12:02:07 +03:00
Liang Kui
82090c60ca
Able to resolve URLs with query params in terminal (#16724)
<img width="207" alt="image"
src="https://github.com/user-attachments/assets/aa7d8de1-313b-4aae-a6c6-00b442b76fb8">

Release Notes:

- URLs with query parameters are now clickable in the terminal
2024-08-23 10:58:53 +03:00
Florian Sanders
bdf26fe38a
Fix JavaScript and TypeScript HTML injections (#16479)
Fixes #16199

## Description

Recently added template string injections do not completely work for
because any time there is an interpolation (`${// some js content}`)
within an element, its closing tag is not highlighted properly:

![image](https://github.com/user-attachments/assets/e660894b-6e4b-4300-b8d9-2757fa235679)

This PR fixes the issue:

![image](https://github.com/user-attachments/assets/629a30c3-9b3a-4338-aee9-622dbb19581c)

Release Notes:

- Fixed incomplete syntax highlighting for HTML injections inside
JavaScript template tags.

## Note

I'm a beginner with treesitter so I only modified the part for HTML
usecase.
Should the same solution be applied to other injections (`css`, `js`,
etc.)?
2024-08-23 08:53:03 +02:00
Conrad Irwin
0fd5030297
Rename is_local to is_local_or_ssh (#16717)
Release Notes:

- N/A
2024-08-22 21:32:51 -06:00
狐狸
46ecd7d190
Fix typo in theme schema (#16711)
Release Notes:

- N/A
2024-08-22 22:36:00 -04:00
Nathan Sobo
88b03bc074
Allow file paths ending in a language-specific-extension to be used as the language name for injections (#12368)
This allows us to detect the language from the extension if we use paths
in fenced code blocks.

Release Notes:

- You can now use file paths ending in a language-specific file
extension at the start of markdown code blocks.
2024-08-22 19:02:49 -06:00
Marshall Bowers
db4ff7da6b
collab: Look up users using github_user_id when backfilling (#16708)
This PR updates the user backfiller to look up the GitHub users using
the `github_user_id` instead of `github_login`.

Release Notes:

- N/A
2024-08-22 19:58:04 -04:00
Conrad Irwin
fb35f15526
Fix linked ranges + multi-cursor (#16707)
Closes: #16695

Release Notes:

- Fixed double edits when a multi-cursor is in a linked editing range
2024-08-22 17:16:07 -06:00
Marshall Bowers
78120cc568
collab: Upsert users by github_user_id instead of github_login (#16706)
This PR makes it so users are upserted by their `github_user_id` instead
of by their `github_login`.

The `github_user_id` is a stable identifier that does not change, while
the `github_login` can change.

In practice we were already using
`get_or_create_user_by_github_account`, which already checks for an
existing user with a `github_user_id` first, so this change doesn't
result in a change in behavior.

This change is primarily for correctness in the event that `create_user`
is called directly, as we want to be upserting by the stable identifier.

Release Notes:

- N/A
2024-08-22 19:15:32 -04:00
Marshall Bowers
4ddf2cbb9f
collab: Make users.github_user_id required and unique (#16704)
This PR makes the `github_user_id` column on the `users` table required
and replaces the index with a unique index.

I have gone through and ensured that all users have a unique
`github_user_id` in the staging and production databases.

Release Notes:

- N/A
2024-08-22 18:27:22 -04:00
张小白
69e76a3bb9
Refactor all_font_names (#15345)
In the current code implementation, it seems that the only difference
between `all_font_names` and `all_font_families` is whether dynamically
loaded font resources are included. Specifically, `all_font_families`
returns the names of all system fonts, while `all_font_names` includes
both the system font names and the dynamically loaded font names. In
other words, `all_font_families` is a strict subset of `all_font_names`.
This is what I observed in my tests on macOS.

<img width="682" alt="截屏2024-07-28 00 49 29"
src="https://github.com/user-attachments/assets/47317c28-0074-49d2-bcfa-052cab13e335">

Related codes:
```rust
let x: HashSet<_> = self.all_font_names().into_iter().collect();
let y: HashSet<_> = self.all_font_families().into_iter().collect();
let only_in_x = x.difference(&y).collect::<Vec<_>>();
let only_in_y = y.difference(&x).collect::<Vec<_>>();
println!("=====================================");
println!("1 -> {:?}", only_in_x);
println!("-------------------------------------");
println!("2 -> {:?}", only_in_y);
```

Release Notes:

- N/A
2024-08-23 00:11:01 +02:00
Kyle Kelley
80c25960dd
repl: Set up a way to copy output from the REPL (#16649)
Closes #15494

Simple copy button to copy an individual output since selection is a bit
more work.

<img width="790" alt="image"
src="https://github.com/user-attachments/assets/4a7d8b69-70cc-428e-8fe3-b95386d341ee">


Release Notes:

- repl: Copy output from the REPL using a button

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-08-22 15:03:42 -07:00
Fernando Tagawa
26f2369fa6
cpp: Add injection for raw string literals (#13726)
Release Notes:

- N/A

Before: 

![Screenshot_20240701_231801](https://github.com/zed-industries/zed/assets/66138117/d0df7819-09e7-4a3b-949d-78e04ff63b23)

After:

![Screenshot_20240702_162856](https://github.com/zed-industries/zed/assets/66138117/943136e1-3b15-482e-bf45-2571cd212eaf)

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-22 15:48:45 -06:00
apricotbucket28
b19356ac69
linux: Ignore benign error when cancelling file picker (#15553)
Fixes https://github.com/zed-industries/zed/issues/15485

This should be clearer on the `ashpd` side, but `ResponseError` comes
from the portal
[Response](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Request.html#org-freedesktop-portal-request-response),
which means the request itself didn't fail. Ignoring the `Other` variant
here should be safe.

Release Notes:

- Linux: Fixed benign error being shown when cancelling file picker
([#15485](https://github.com/zed-industries/zed/issues/15485))
2024-08-22 14:43:02 -07:00
apricotbucket28
7523a7a437
wayland: Do not reset clipboard data offer on keyboard leave (#16126)
Closes #14415 
(also removed an unused serial while I was at it)

Release Notes:

- Linux: Fixed cross-window copy/paste not working in some Wayland
configurations.
2024-08-22 14:42:32 -07:00
Knoqx
abc712014a
Recursive tab/pane closing on folder deletion (#15222)
Release Notes:

- Added tab/pane closing for files inside a folder being deleted/trashed

Behavior prior:

[Screencast from 2024-07-25
16-26-47.webm](https://github.com/user-attachments/assets/b090f582-bd7e-411d-91b9-d6709aca7295)

New behavior:

[Screencast from 2024-07-25
16-27-53.webm](https://github.com/user-attachments/assets/b35d4c3a-b0ab-4bd3-bcee-e8b6ad1419c3)

This is primarily a proof of concept PR as I'm sure there are more
elegant ways of achieving this. It's been bothering me for a little
while manually closing file tabs in a folder I deleted, and since this
is standard behavior on almost all IDEs and text editors I figured it
would be a nice small little challenge. If there are any changes y'all
want made I'd be happy to.
2024-08-22 15:24:41 -06:00
apricotbucket28
e7c8dba54f
cosmic_text: Handle subpixel variants (#16238)
Closes https://github.com/zed-industries/zed/issues/14169, closes
https://github.com/zed-industries/zed/issues/14387


| Before  | After |
| --- | ---|
|
![image](https://github.com/user-attachments/assets/e7acbcbf-6384-49f8-bfe4-96d70d957df2)
|
![image](https://github.com/user-attachments/assets/704fac78-3946-4c5f-a02d-346653b77c5a)
|
|
![image](https://github.com/user-attachments/assets/50c40a23-47a8-4bc4-9a8c-df763df38f18)
|
![image](https://github.com/user-attachments/assets/37e5b1a6-0e16-4564-a47e-94f4e6d82c10)
|

Release Notes:

- Linux: Improved text rendering by handling subpixel positioning.
2024-08-22 15:17:56 -06:00
Congyu
99d45ba694
Add socks proxy for client websocket connection (#16051)
Release Notes:

- Added socks proxy for client websocket connection
2024-08-22 14:52:18 -06:00
Vitor Ramos
f45af17fd4
Add option to pipe from stdin on cli (#16084)
Closes #5044

Release Notes:

- Linux: Added CLI pipe support.
2024-08-22 13:31:58 -06:00
Heewon Cho
e1b05bf7a3
Fix opening uncanonicalized hyperlink file from terminal (#16087)
Closes #11284

Release Notes:

- Fixed bug in opening uncanonicalized hyperlink file from terminal


https://github.com/user-attachments/assets/558725e0-6bf3-43cb-b833-161209360a4d
2024-08-22 13:23:44 -06:00
张小白
c0ea806afe
windows: Treat pwsh as PowerShell (#16409)
`pwsh` is the newer version of `PowerShell`, while the one that comes
pre-installed on Windows is called `Windows PowerShell` and is an older
version. I have no idea why Microsoft dose this and not updated the
`Windows Powershell` on Windows.

Release Notes:

- N/A
2024-08-22 13:05:00 -06:00
Cherry
e1c42a5c85
fs: Fix atomic_write failing on windows if destination is in different drive than the temp dir (#16648)
I have my system temp dir on a different drive than the default, so this
error was spammed in the logs. This also broke Zed in many ways, one of
which was the AI system failing to work since it couldn't save settings.
```
2024-08-20T22:39:54.0660708-07:00 [ERROR] Failed to write settings to file "\\\\?\\C:\\Users\\myuser\\AppData\\Roaming\\Zed\\settings.json"
Caused by:

0: failed to persist temporary file: The system cannot move the file to a different disk drive. (os error 17)

1: The system cannot move the file to a different disk drive. (os error 17)
```

Note: This problem is probably present on MacOS due to the requirement
of the underlying api being used. I do not have Mac, so I cannot test
this. This PR only solves this issue on Windows.

Closes #16571

Release Notes:

- fix atomic_write failing on windows if destination is on a different
drive than the OS's temp dir.
2024-08-22 12:59:00 -06:00
bestgopher
e17a5c1412
Fix log timestamps not using local timezone (#16400)
Get time offset by time crate will fail if there are mutli threads. So
call `config_builder.set_time_offset_to_local()` is useless.

Closes #16397

after:
<img width="664" alt="image"
src="https://github.com/user-attachments/assets/2b15fa06-c411-44f9-9ea1-871d25eb577f">

Release Notes:

- Fixed Local Timezone not showing Zed.log
2024-08-22 12:56:49 -06:00
0x2CA
abb5800d20
Add bounded soft wrap (#16586)
Closes #14700 #8164

Release Notes:

- Added `soft_wrap` value `bounded`,EditorWidth and PreferredLineLength
min value

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-08-22 12:51:32 -06:00
Conrad Irwin
c697eaba82
Use split direction preferences more (#16679)
Use new split direction preferences in more places (#16345)

Release Notes:

- N/A
2024-08-22 11:13:33 -06:00
Marshall Bowers
93642c9c51
Pass through Anthropic cache configuration when using Zed provider (#16685)
This PR makes it so the model's cache configuration gets passed through
from the base model when using the Zed provider.

Release Notes:

- Fixed caching for Anthropic models when using the Zed provider.
2024-08-22 12:48:47 -04:00
Piotr Osiewicz
182b7af299
ui: Use popover menus for tab bar in panes (#16497)
Closes #ISSUE

Release Notes:

- N/A
2024-08-22 18:05:23 +02:00
Kirill Bulatov
72b5cda356
Deduplicate /tab all buffers inserted (#16681)
Closes https://github.com/zed-industries/zed/issues/16678

Release Notes:

- Fixed `/tab all` inserting duplicate buffers
([!16678](https://github.com/zed-industries/zed/issues/16678))
2024-08-22 19:04:03 +03:00
Jeroen van Baarsen
3a593fe803
Add option to set split direction (#16345)
This adds an option to set the split direction for both the horizontal
splits, and the vertical splits.

A couple of things to look for when reviewing:

* The `derive` keywords on the Enums were copy pasted, no clue what they
should be
* Tried adding tests for this, but got stuck.

Co-authored with @Tobbe

Fixes: https://github.com/zed-industries/zed/issues/11342
2024-08-22 08:53:43 -06:00
Jonathan Dickinson
278864e19f
lsp_log: Show messages before init and add filtering (#15893)
Allows language server logs to be published prior to the completion of
the initialize request. OmniSharp is one example of an LSP that
publishes (many) messages prior to the initialization response, and this
completely floods the Zed logs.

Also adds level filtering as demonstrated below. Again, this is due to
my experience with the massive amount of log messages that OmniSharp
publishes.

Release Notes:

- Added level filtering to language server logs

![Log Level
Filtering](https://github.com/user-attachments/assets/e3fcb7af-28cb-4787-9068-8e5e7eb3cf7d)

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-08-22 16:47:34 +02:00
Tau Gärtli
9245015d1a
terminal: Retain relative order of responses (#16456)
Partially addresses #8497 (namely, the occurring with `delta`)

As I mentioned in
https://github.com/zed-industries/zed/issues/8497#issuecomment-2226896371,
zed currently replies to OSC color requests (`OSC 10`, `OSC 11`, ...)
out of order when immediately followed by another request (for example
`CSI c`). All other terminals that [I have
tested](https://github.com/bash/terminal-colorsaurus/blob/main/doc/terminal-survey.md)
maintain relative order when replying to requests.

## Solution
Respond to the `ColorRequest` in `process_event` (in the same place
where other PTY writes happen) instead of queuing it up in the internal
event queue.

## Alternative
I initially thought that I could handle the color request similarly to
the `TextAreaSizeRequest` where the size is stored in `last_content` and
updated on `sync`. However this causes the terminal to report
out-of-date values when a "set color" sequence is followed by a color
request.

## Tests

1. `OSC 11; ?` (request bg color) + `CSI c` (request device attributes):
   ```shell
   printf '\e]11;?\e\\ \e[c' && cat -v
   # Expected result: ^[]11;rgb:dcdc/dcdc/dddd^[\^[[?6c
# Current result: ^[[?6c^[]11;rgb:dcdc/dcdc/dddd^[\ ()
# Result with this PR: ^[]11;rgb:dcdc/dcdc/dddd^[\^[[?6c ()
# Result with alternative: ^[]11;rgb:dcdc/dcdc/dddd^[\^[[?6c ()
   ```
2. `OSC 11; rgb:f0f0/f0f0/f0f0` (set bg color) + `OSC 11; ?` (request bg
color)
   ```shell
   printf '\e]11;rgb:f0f0/f0f0/f0f0\e\\ \e]11;?\e\\' && cat -v
   # Expected result: ^[]11;rgb:f0f0/f0f0/f0f0^[\
# Current result: ^[]11;rgb:f0f0/f0f0/f0f0^[\ ()
# Result with this PR: ^[]11;rgb:f0f0/f0f0/f0f0^[\ ()
# Result with alternative: ^[]11;rgb:OUT_OF_DATE_COLOR_HERE^[\ ()
   ```

Release Notes:

- N/A
2024-08-22 16:19:24 +02:00
Kajus
b7a66e4491
project_panel: Allow copying the paths of multiple selected files at once (#16558)
Closes #16555 

Release Notes:

- Improved the "Copy Path" and "Copy Relative Path" actions in the
project panel's context menu when selecting multiple files. All selected
files' paths will now be copied, separated by newlines.
2024-08-22 16:05:01 +02:00
Kirill Bulatov
6b9fa68dc5
Force Vue and Svelte language servers to be the first in the list for their languages (#16654)
Follow-up of https://github.com/zed-industries/zed/pull/15624

Fixes https://github.com/zed-industries/zed/issues/13769
Fixes https://github.com/zed-industries/zed/issues/16469

This way, those are considered "primary" and serve all LSP requests like
go to definition. Before, Tailwind language server was first and
returned nothing for all LSP requests.

- Fixed Vue and Svelte languages integrations not handling LSP requests
properly ([#13769](https://github.com/zed-industries/zed/issues/13769))
([#16469](https://github.com/zed-industries/zed/issues/16469))
2024-08-22 15:36:31 +03:00
Thorsten Ball
db0c1fd592
vim: Add 'gf' command, make files cmd-clickable (#16534)
Release Notes:

- vim: Added `gf` command to open files under the cursor.
- Filenames can now be `cmd`/`ctrl`-clicked, which opens them.

TODOs:

- [x] `main_test.go` <-- works
- [x] `./my-pkg/my_pkg.go` <-- works
- [x] `../go.mod` <-- works
- [x] `my-pkg/my_pkg.go` <-- works
- [x] `my-pkg/subpkg/subpkg_test.go` <-- works
- [x] `file\ with\ space\ in\ it.txt` <-- works
- [x] `"file\ with\ space\ in\ it.txt"` <-- works
- [x] `"main_test.go"` <-- works
- [x] `/Users/thorstenball/.vimrc` <-- works, but only locally
- [x] `~/.vimrc` <--works, but only locally
- [x] Get it working over collab
- [x] Get hover links working

Demo:



https://github.com/user-attachments/assets/26af7f3b-c392-4aaf-849a-95d6c3b00067

Collab demo:




https://github.com/user-attachments/assets/272598bd-0e82-4556-8f9c-ba53d3a95682
2024-08-22 14:27:11 +02:00
Conrad Irwin
eb9eae09b1
Fix manual copilot with show_inline_completions: false (#16621)
For @mre and friends!

Release Notes:

- Fixed manually trigging completions when `show_inline_completions:
false`
2024-08-21 20:27:19 -06:00
Peter Tripp
136f75ee9a
docs: Update telemetry documentation (#16628)
- Add references to locations in code for Metrics and Panic telemetry
- Remove outdated documentation (ClickhouseEvent,
ClickhouseEventWrapper, ClickhouseEventRequestBody)
- Migrate struct documentation from web docs to inline doc comments on
struct members.
2024-08-21 20:24:35 -04:00
Marshall Bowers
1d986b0c77
collab: Report active user counts separately, as well (#16629)
This PR adds additional reporting of the active user counts as separate
logs.

We were already reporting these on individual rate limit events/logs,
but it seems like something that would be good to report on independent
of user activity.

Release Notes:

- N/A
2024-08-21 18:15:15 -04:00
Cherry
feab1261c8
Fix some typos (#16623)
This PR fixes some typos I found in the source code.

Release Notes:

- N/A
2024-08-21 17:33:19 -04:00
Michael Angerman
406d3b413d
gpui: Remove extra "which" in comment (#16620)
Fix a typo in the comment...

Release Notes:

- N/A
2024-08-21 17:24:38 -04:00
Marshall Bowers
0229d3ccac
collab: Track active user counts independently for each model (#16624)
This PR fixes an issue where the active user count spanned individual
models.

We now track the active user counts on a per-model basis.

Release Notes:

- N/A
2024-08-21 17:19:47 -04:00
Thorben Kröger
f85ca387a7
clangd: Implement switch source/header extension (#14646)
Release Notes:

- Added switch source/header action for clangd language server (fixes
[#12801](https://github.com/zed-industries/zed/issues/12801)).

Note: I'm new to both rust and this codebase. I started my
implementation by copying how rust analyzer's "expand macro" LSP
extension is implemented. I don't yet understand some of the code I
copied (mostly the way to get the `server_to_query` in `clangd_ext.rs`
and the whole proto implementation).

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-08-21 22:15:08 +03:00
Marshall Bowers
96bcceed40
collab: Add traces for user LLM rate limits (#16610)
This PR adds traces for when users hit LLM rate limits.

We were already emitting telemetry events for these to Clickhouse, but
it will be handy to have them available in Axiom as well.

Release Notes:

- N/A
2024-08-21 15:13:55 -04:00
Kyle Kelley
2ad9a742dd
repl: Add restart kernel action and improve shutdown (#16609)
- Implement restart kernel functionality
- Clean up shutdown process to properly drop messaging and exit status
tasks
- Refactor kernel state handling for better consistency

Closes #16037

Release Notes:

- repl: Added restart kernel action
- repl: Fixed issue with shutting down kernels that are in a failure
state
2024-08-21 11:51:58 -07:00
Ikko Eltociear Ashimine
9f0438b540
gpui: Remove extra "the" in comment (#16608)
Release Notes:

- N/A
2024-08-21 14:07:51 -04:00
Marshall Bowers
d274be67d6 Mark the user-backfiller secret as optional 2024-08-21 13:25:05 -04:00
Marshall Bowers
19f0c4af6d
collab: Update user backfiller to be mindful of GitHub rate limits (#16602)
This PR updates the user backfiller to be mindful of GitHub rate limits
and back off when rate-limited.

Release Notes:

- N/A
2024-08-21 13:23:24 -04:00
Conrad Irwin
09c698d8d7
Fix a panic when diagnostics contain multiple links (#16601)
Follow up from #14518

Release Notes:

- Fixed a panic when diagnostics contain multiple links
2024-08-21 11:18:43 -06:00
Marshall Bowers
8a5fcc2c22
collab: Backfill github_user_created_at on users (#16600)
This PR adds a backfiller to backfill the `github_user_created_at`
column on users.

Release Notes:

- N/A
2024-08-21 12:38:51 -04:00
Thorsten Ball
28568429aa
collab panel: Unfocus filter editor on escape (#16579)
This has been bugging me for a while, because it meant I was stuck in
the collab panel when I accidentally navigated there via keyboard
shortcuts.

Now I can press esc and get out of that state.

Release Notes:

- Fixed `esc` not removing focus from the filter editor in the
collaboration panel.

### Before


https://github.com/user-attachments/assets/3bebac03-0e6a-49b0-9823-d9f3190aa5d2


### After


https://github.com/user-attachments/assets/d04c309d-9d1c-44b6-abd3-d48f55207e31
2024-08-21 09:38:12 +02:00
邻二氮杂菲
f1778dd9de
Add max_output_tokens to OpenAI models and integrate into requests (#16381)
### Pull Request Title
Introduce `max_output_tokens` Field for OpenAI Models


https://platform.deepseek.com/api-docs/news/news0725/#4-8k-max_tokens-betarelease-longer-possibilities

### Description
This commit introduces a new field `max_output_tokens` to the OpenAI
models, which allows specifying the maximum number of tokens that can be
generated in the output. This field is now integrated into the request
handling across multiple crates, ensuring that the output token limit is
respected during language model completions.

Changes include:
- Adding `max_output_tokens` to the `Custom` variant of the
`open_ai::Model` enum.
- Updating the `into_open_ai` method in `LanguageModelRequest` to accept
and use `max_output_tokens`.
- Modifying the `OpenAiLanguageModel` and `CloudLanguageModel`
implementations to pass `max_output_tokens` when converting requests.
- Ensuring that the `max_output_tokens` field is correctly serialized
and deserialized in relevant structures.

This enhancement provides more control over the output length of OpenAI
model responses, improving the flexibility and accuracy of language
model interactions.

### Changes
- Added `max_output_tokens` to the `Custom` variant of the
`open_ai::Model` enum.
- Updated the `into_open_ai` method in `LanguageModelRequest` to accept
and use `max_output_tokens`.
- Modified the `OpenAiLanguageModel` and `CloudLanguageModel`
implementations to pass `max_output_tokens` when converting requests.
- Ensured that the `max_output_tokens` field is correctly serialized and
deserialized in relevant structures.

### Related Issue
https://github.com/zed-industries/zed/pull/16358

### Screenshots / Media
N/A

### Checklist
- [x] Code compiles correctly.
- [x] All tests pass.
- [ ] Documentation has been updated accordingly.
- [ ] Additional tests have been added to cover new functionality.
- [ ] Relevant documentation has been updated or added.

### Release Notes

- Added `max_output_tokens` field to OpenAI models for controlling
output token length.
2024-08-21 00:39:10 -04:00
Conrad Irwin
36d51fe4a5
vim: Improve lifecycle (#16477)
Closes #13579

A major painpoint in the Vim crate has been life-cycle management. We
used to have one global Vim instance that tried to track per-editor
state; this led to a number of subtle issues (e.g. #13579, the mode
indicator being global, and quick toggling between windows letting vim
mode's notion of the active editor get out of sync).

This PR changes the internal structure of the code so that there is now
one `Vim` instance per `Editor` (stored as an `Addon`); and the global
stuff is separated out. This fixes the above problems, and tidies up a
bunch of the mess in the codebase.

Release Notes:

* vim: Fixed accidental visual mode in project search and go to
references
([#13579](https://github.com/zed-industries/zed/issues/13579)).
2024-08-20 20:48:50 -06:00
Eli Perkins
a1438a49df
project_panel: Set scrollbar track background from theme (#16546)
This was previously using the value for the scrollbar border, instead of
the background.

I noticed this while trying out a new Zed theme.

Release Notes:

- Updated project panel scrollbar to respect the
`scrollbar.track.background` from the theme.

| Before | After |
| --- | ---- |
| <img width="281" alt="Screenshot 2024-08-20 at 2 46 23 PM"
src="https://github.com/user-attachments/assets/46d48e75-f472-4060-bcd7-9c2f7d97963d">
| <img width="280" alt="Screenshot 2024-08-20 at 2 46 37 PM"
src="https://github.com/user-attachments/assets/081038a4-4337-4c9f-9a95-93497003fb56">
|
2024-08-20 17:11:07 -04:00
Sinan Gençoğlu
ff7017c308
Replace lazy_static with std::sync::LazyLock (#16066)
Closes #15860 

Since rust std now supports LazyLock replacing lazy_static with it
reduce the external dependency.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-20 14:27:33 -04:00
Marshall Bowers
8381b06d2d
gpui: Fix "cursor" typos (#16536)
This PR fixes some typos of the word "cursor" in `gpui`.

Release Notes:

- N/A
2024-08-20 13:49:15 -04:00
Matthew D. Scholefield
5c0d800b21
Make unnecessary code fade configurable (#14442)
This PR allows configuring the intensity of code fade applied to unused
code (relates to #4785).

_Note: Right now I included it as a top level config which might be a
little out of place (but is easiest to instrument). Open for suggestions
on where else it would be better suited for._

_Note 2: I am unfamiliar with the codebase. Feel free to either close
this PR and re-implement in a better way or suggest high level changes
if I'm approaching anything wrong :)._

Release Notes:

- Added `unnecesary_code_fade` setting to control how strongly to fade
unused code.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-08-20 13:13:27 -04:00
Suhun Han
b67404323c
workspace: Improve error handling when dropping a file that cannot be opened into the workspace pane (#15613)
This PR can improve the UX when dropping a file that cannot be opened
into the workspace pane. Previously, nothing happened without any
messages when such error occurred, which could be awkward for users.
Additionally the pane was being split even though the file failed to
open.

Here's a screen recording demonstrating the previous/updated behavior:


https://github.com/user-attachments/assets/cfdf3488-9464-4568-b16a-9b87718bd729

Changes:

- It now displays an error message if a file cannot be opened.
- Updated the logic to first try to open the file. The pane splits only
if the file opening process is successful.

Release Notes:

- Improved error handling when opening files in the workspace pane. An
error message will now be displayed if the file cannot be opened.
- Fixed an issue where unnecessary pane splitting occurred when a file
fails to open.
2024-08-20 15:05:59 +02:00
Kirill Bulatov
e482fcde5b
Fall back to FindAllReferences if GoToDefinition have not navigated (#16512)
Follow-up of https://github.com/zed-industries/zed/pull/9243 

Release Notes:

- N/A

---------

Co-authored-by: Alex Kladov <aleksey.kladov@gmail.com>
2024-08-20 14:56:19 +03:00
Marshall Bowers
395a68133d
Add Postgrest to Docker Compose (#16498)
This PR adds two Postgrest containers—one for the app database and one
for the LLM database—to the Docker Compose cluster.

Also fixed an issue where `postgres_app.conf` and `postgres_llm.conf`
had been switched.

Release Notes:

- N/A
2024-08-19 20:50:45 -04:00
Marshall Bowers
f7f7cd5bb9
repl: Don't prefix free variables with _ (#16494)
This PR is a small refactor to remove the leading `_` for some free
variables, as this unintentionally marks them as unused to the compiler.

While the fields on the struct _are_ unused, the free variables should
participate in usage tracking, as we want to make sure they get stored
on the struct.

Release Notes:

- N/A
2024-08-19 19:15:27 -04:00
Bennet Bo Fenner
6f5674691c
assistant: Set default provider to zed.dev (#16454)
Do NOT merge until tomorrow

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-08-19 19:00:38 -04:00
Joseph T Lyons
9f66f12f7b v0.151.x dev 2024-08-19 18:40:19 -04:00
Max Brunsfeld
30bfa56a24
Avoid double message header in new contexts, don't expand default prompt (#16490)
Follow-up to https://github.com/zed-industries/zed/pull/16471

* Don't expand the default prompt by default, since it looks strange in
the expanded state
* Don't create two `You` headers by default. Just insert a blank line
after the default prompt.

Release Notes:

- N/A
2024-08-19 12:54:03 -07:00
Roy Williams
0042c24d3c
Simplify logic & add UI affordances to show model cache status (#16395)
Release Notes:

- Adds UI affordances to the assistant panel to show which messages have
been cached
- Migrate cache invalidation to be based on `has_edits_since_in_range`
to be smarter and more selective about when to invalidate the cache and
when to fetch.

<img width="310" alt="Screenshot 2024-08-16 at 11 19 23 PM"
src="https://github.com/user-attachments/assets/4ee2d111-2f55-4b0e-b944-50c4f78afc42">

<img width="580" alt="Screenshot 2024-08-18 at 10 05 16 PM"
src="https://github.com/user-attachments/assets/17630a60-7b78-421c-ae39-425246638a12">


I had originally added the lightening bolt on every message and only
added the tooltip warning about editing prior messages on the first
anchor, but thought it looked too busy, so I settled on just annotating
the last anchor.
2024-08-19 12:06:14 -07:00
Max Brunsfeld
b5bd8a5c5d
Add logic for closed beta LLM models (#16482)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-08-19 11:09:52 -07:00
Nate Butler
41fc6d0885
Make providers more clear in model selector (#16480)
Make providers more clear in model selector

Before:

![CleanShot 2024-08-19 at 13 20
36@2x](https://github.com/user-attachments/assets/5b43fa27-4aca-446a-a035-bc8bcb0d9b0e)

After:

![CleanShot 2024-08-19 at 13 20
05@2x](https://github.com/user-attachments/assets/cb961405-b573-42fe-80e1-f3c2ce828ea4)


Release Notes:

- N/A
2024-08-19 13:38:19 -04:00
Bennet Bo Fenner
90897707c3
assistant: Add imports in a single area when using workflows (#16355)
Co-Authored-by: Kirill <kirill@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Kirill <kirill@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
2024-08-19 19:01:45 +02:00
Piotr Osiewicz
7fbea39566
ui: Dismiss popovers when clicking on trigger button (#16476)
Release Notes:

- Clicking on an already-deployed popover menu trigger now hides the
popover menu.
2024-08-19 18:48:57 +02:00
Thorsten Ball
037cf1393c
assistant: Undo workflow step when buffer is discarded (#16465)
This fixes a weird bug:

1. Use `/workflow` in assistant
2. Have it generate a step that modifies a file
3. Either (a) select the step in the assistant and have it auto-insert
newlines (b) select "Transform" to have the step applied
4. Close the modified file in the editor ("Discard")
5. Re-open the file
6. BUG: the changes made by assistant are still there!

The reason for the bug is that the assistant keeps references to buffers
and they're not closed/reloaded when closed/reopened.

To fix the bug we now rollback the applied workflow steps when
discarding a buffer.

(This does *not* yet fix the issue where a workflow step inserts a new
buffer into the project/worktree that does not show up on the file
system yet but in `/file` and hangs around until Zed is closed.)


Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-19 18:42:49 +02:00
Kirill Bulatov
69aae2037d
Display default prompts more elaborately (#16471)
Show them under `User` role instead of a `System` one, and insert them
expanded.

Release Notes:

- N/A
2024-08-19 18:44:52 +03:00
Piotr Osiewicz
bac8e81e73
assistant: Add the "create your command" item (#16467)
This PR adds an extra item to the slash command picker that links users to the doc that teaches how to create a custom one.

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2024-08-19 12:29:16 -03:00
Marshall Bowers
0bea4d5fa6
theme: Change autocomplete value for ui_font_features and buffer_font_features (#16466)
This PR changes the default value used when autocompleting the
`ui_font_features` and `ui_font_features` settings from `null` to `{}`.

Release Notes:

- N/A
2024-08-19 10:55:25 -04:00
Marshall Bowers
de41c151c8
collab: Add is_staff to upstream rate limit spans (#16463)
This PR adds the `is_staff` field to the `upstream rate limit` spans.

Since we use different API keys for staff vs non-staff, it will be
useful to break down the rate limits accordingly.

Release Notes:

- N/A
2024-08-19 10:15:25 -04:00
Piotr Osiewicz
56f1ab9459
assistant: Remove "Resolving" text for step resolution and use Transform instead (#16461)
That way, user can click on "Transform" straight away and get it applied
immediately when it's resolved.



https://github.com/user-attachments/assets/08c99804-3841-4eba-a5eb-7066a9f45b47


TODO:
- [x] Tie "Send" button at the bottom into the same behavior

Release Notes:

- N/A
2024-08-19 15:17:04 +02:00
Piotr Osiewicz
911112d94a
assistant: Fix toggling slash command menu from toolbar menu (#16459)
Release Notes:

- N/A
2024-08-19 14:47:05 +02:00
Thorsten Ball
e68b2d5ecc
assistant panel: Disable send button on config error (#16455)
Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-19 11:44:56 +02:00
Thorsten Ball
f651333896
assistant panel: Show if env var with API key is set (#16453)
This makes it easier to debug why resetting a key doesn't work. We now
show when the key is set via an env var and if so, we disable the
reset-key button and instead give instructions.

![screenshot-2024-08-19-11 22
05@2x](https://github.com/user-attachments/assets/6c75dc82-cb61-4661-9647-f77fca8fdf41)


Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-08-19 11:34:58 +02:00
Bennet Bo Fenner
14fa4abce4
assistant: Fix edge case where "Open new context" button would do nothing (#16452)
Co-Authored-by: Thorsten <thorsten@zed.dev>

Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-08-19 11:07:04 +02:00
Ryan Hawkins
8a320668ed
Add support for GPT-4o in Copilot Chat (#16446)
Release Notes:
- Added support for GPT-4o for Copilot Chat.
2024-08-19 09:03:06 +02:00
Mikayla Maki
86efde4b76
Fixed bugs in workflow step preview (#16445)
Release Notes:

- N/A
2024-08-18 22:18:04 -07:00
Nathan Sobo
b9176fe4bb
Add custom icon for Anthropic hosted models (#16436)
This commit adds a custom icon for Anthropic hosted models.


![CleanShot 2024-08-18 at 15 40
38@2x](https://github.com/user-attachments/assets/d467ccab-9628-4258-89fc-782e0d4a48d4)
![CleanShot 2024-08-18 at 15 40
34@2x](https://github.com/user-attachments/assets/7efaff9c-6a58-47ba-87ea-e0fe0586fedc)


- Adding a new SVG icon for Anthropic hosted models.
  - The new icon is located at: `assets/icons/ai_anthropic_hosted.svg`
- Updating the LanguageModel trait to include an optional icon method
- Implementing the icon method for CloudModel to return the custom icon
for Anthropic hosted models
- Updating the UI components to use the model-specific icon when
available
- Adding a new IconName variant for the Anthropic hosted icon

We should change the non-hosted icon in some small way to distinguish it
from the hosted version. I duplicated the path for now so we can
hopefully add it for the next release.

Release Notes:

- N/A
2024-08-18 16:07:15 -06:00
Nathan Sobo
11753914d7
Add a setting to show time to first window draw and frames per second in status bar (#16422)
I want to showcase Zed's performance via videos, and this seemed like a
good way to demonstrate it.


https://github.com/user-attachments/assets/f4a5fabc-efe7-4b48-9ba5-719882fdc856

Release Notes:

- On macOS, you can now set assign `performance.show_in_status_bar:
true` in your settings to show the time to the first window draw on
startup and then current FPS of the containing window's renderer.

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: David Soria Parra <167242713+dsp-ant@users.noreply.github.com>
Co-authored-by: Danny Hua <danny.hua@hey.com>
2024-08-18 15:22:19 -06:00
David Soria Parra
10a996cbc4
context_servers: Fix argument handling (#16402) 2024-08-17 20:04:34 -07:00
Kirill Bulatov
5e6e465294
Show correct number of characters selected (#16420) 2024-08-18 02:24:32 +03:00
Max Brunsfeld
8841d6faad
Avoid redundant newline insertion after file command (#16419)
Release Notes:

- Fixed an issue where an extra newline was inserted after running a
`/file` command in the assistant.
2024-08-17 15:10:10 -07:00
Nathan Sobo
c9c5eef8f2
Improve dev experience for built-in prompts (#16413)
When launching Zed from the CLI via `cargo run`, we'll always prompt
load templates from the repo.

This restores behavior that I reverted last night in #16403.

Also, I've improved the `script/prompts link/unlink` workflow for
overriding prompts of your production copy of Zed. Zed now detects when
the overrides directory is created or removed, and does the right thing.
You can link and unlink repeatedly without restarting Zed.

Release Notes:

- N/A
2024-08-17 12:28:53 -06:00
Danilo Leal
7c268d0c6d
assistant: Remove meta description from quote selection tooltip (#16412)
The original idea was for the keybinding to be within the description, but given it's already inline with the title, I figure we don't need this anymore—cleaning it up a bit!

--- 

Release Notes:

- N/A
2024-08-17 13:30:32 -03:00
Danilo Leal
e4a591dcbd
workflow: Add button to open the step view (#16387)
This PR adds an icon button that appears as you hover over the step header, which allows users to visit the step view.

---

Release Notes:

- N/A
2024-08-17 13:06:34 -03:00
Nathan Sobo
07d5e22cbe
Revert changes to inline assist indentation logic and prompt (#16403)
This PR reverts #16145 and subsequent changes.

This reverts commit a515442a36.

We still have issues with our approach to indentation in Python
unfortunately, but this feels like a safer equilibrium than where we
were.

Release Notes:

- Returned to our previous prompt for inline assist transformations,
since recent changes were introducing issues.
2024-08-17 02:24:55 -06:00
Joseph T. Lyons
ebecd7e65f
Fix issue with fetching users in seed script (#16393)
Release Notes:

- N/A
2024-08-16 21:51:51 -04:00
Marshall Bowers
3d997e5fd6
collab: Add is_staff to spans (#16389)
This PR adds the `is_staff` field to our LLM spans so that we can
distinguish between staff and non-staff traffic.

Release Notes:

- N/A
2024-08-16 18:42:44 -04:00
Max Brunsfeld
1b1070e0f7
Add tracing needed for LLM rate limit dashboards (#16388)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-08-16 17:52:31 -04:00
Joseph T. Lyons
9ef3306f55
Add feature flags to seed script (#16385)
Release Notes:

- N/A
2024-08-16 17:08:44 -04:00
Kyle Kelley
0fdc9d0f05
context_servers: Log errors from detached context server tasks (#16377)
Logged several of the detached tasks that before would silently fail if
the context server wasn't in compliance.

Release Notes:

- N/A
2024-08-16 13:50:19 -07:00
Nathan Sobo
907d76208d
Allow display name of custom Anthropic models to be customized (#16376)
Also added some docs for our settings.

Release Notes:

- N/A
2024-08-16 14:02:37 -06:00
Kirill Bulatov
ae9e6a9daa
Allow rerunning tasks with unknown termination status (#16374) 2024-08-16 23:00:20 +03:00
Danilo Leal
e36e605c96
assistant: Fine-tune error toast design (#16373)
Just some super small padding and absolute-positioning tweaks. 

---

Release Notes:

- N/A
2024-08-16 16:56:52 -03:00
Marshall Bowers
35cd397a40
collab: Allow enabling feature flags for all users (#16372)
This PR adds a new `enabled_for_all` column to the `feature_flags` table
to allow enabling a feature flag for all users.

Release Notes:

- N/A
2024-08-16 15:17:03 -04:00
Danilo Leal
2180dbdb50
assistant: Add action footer and refine slash command popover (#16360)
- [x] Put the slash command popover on the footer
- [x] Refine the popover (change it to a picker)
- [x] Add more options dropdown on the assistant's toolbar
- [x] Add quote selection button on the footer

---

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-08-16 16:07:42 -03:00
Mikayla Maki
23d56a1a84
Add configuration flow for inline assist button (#16369)
This adds a configuration prompt when using the inline assist button in
the editor.

Release Notes:

- N/A
2024-08-16 11:21:30 -07:00
Marshall Bowers
a9441879c3
collab: Fix writing LLM rate limit events to Clickhouse (#16367)
This PR fixes the writing of LLM rate limit events to Clickhouse.

We had a table in the table name: `llm_rate_limits` instead of
`llm_rate_limit_events`.

I also extracted a helper function to write to Clickhouse so we can use
it anywhere we need to.

Release Notes:

- N/A
2024-08-16 14:03:34 -04:00
Nate Butler
6cfbb54ede
Switch icon (#16363)
Updates instances of the `MagicWand` icon to our more recent `Sparkle` /
`ZedAssistant` icon in places where we reference inline assist.

Before:

![CleanShot 2024-08-16 at 13 41
58@2x](https://github.com/user-attachments/assets/67af27a2-a09b-44bb-a8af-2bafcbbd9038)

After:
![CleanShot 2024-08-16 at 13 48
34@2x](https://github.com/user-attachments/assets/229ccc8e-8a93-44c1-abe0-7b6e22ca93e2)


Release Notes:

- Updated inline assist icon in the editor & terminal.
2024-08-16 14:01:56 -04:00
Marshall Bowers
7a5acc0b0c
collab: Rework model name checks (#16365)
This PR reworks how we do checks for model names in the LLM service.

We now normalize the model names using the models defined in the
database.

Release Notes:

- N/A
2024-08-16 13:54:28 -04:00
Joseph T. Lyons
ebac9a7342
Combine assistant documentation (#16362)
Release Notes:

- N/A
2024-08-16 13:37:54 -04:00
Mikayla Maki
455850505f
Fix more bugs in files (#16241)
Fixes:
- [x] an issue where directories would only match by prefix, causing
both a directory and a file to be matched if in the same directory
- [x] An issue where you could not continue a file completion when
selecting a directory, as `tab` on a file would always run the command.
This effectively disabled directory sub queries.
- [x] Inconsistent rendering of files and directories in the slash
command

Release Notes:

- N/A

---------

Co-authored-by: max <max@zed.dev>
2024-08-16 10:09:38 -07:00
Roy Williams
b4f5f5024e
Support 8192 output tokens for Claude Sonnet 3.5 (#16358)
Release Notes:

- Added support for 8192 output tokens from Claude Sonnet 3.5
(https://x.com/alexalbert__/status/1812921642143900036)
2024-08-16 11:47:39 -04:00
Kirill Bulatov
f1a2638d29
Do not enable copilot for always read-only editors (#16356)
Release Notes:

- N/A
2024-08-16 17:22:47 +03:00
Kirill Bulatov
0fe22f2a48
After streaming generation is over, show a regular, batch diff in the file altered (#16350)
Release Notes:

- N/A
2024-08-16 15:31:02 +03:00
Kyle Kelley
f7f5a25584
repl: Apply border for error output on left (#16334) 2024-08-16 00:31:46 -05:00
张小白
40d97fd346
windows: Fix missing title bar on prompt library (#16302)
Closes #16297

It seems that currently we can't draw custom title bar. I have checked
the `title_bar` crate, it seems to be `zed` only.

Before:

![Screenshot 2024-08-16
004350](https://github.com/user-attachments/assets/e11aa0bb-9d3e-47d5-b488-d3b8220158cc)

After:

![Screenshot 2024-08-16
004235](https://github.com/user-attachments/assets/028b4eb2-c878-4ea7-87e3-22817caefa00)


Release Notes:

- N/A
2024-08-15 22:23:11 -06:00