Commit Graph

16625 Commits

Author SHA1 Message Date
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
Kirill Bulatov
9384f665bb
Properly extract errors from the Anthropic API (#15534)
Before, we missed "successful" responses with the API errors, now they
are properly shown in the assistant panel.


![image](https://github.com/user-attachments/assets/0c0936af-86c2-4def-9a58-25d5e0912b97)


Release Notes:

- N/A
2024-07-31 16:31:11 +03:00
Bennet Bo Fenner
821ce2fc7c
assistant panel: Fix panel not reloading after entering credentials (#15531)
This is the revised version of #15527.

We also added new events to notify subscribers when new providers are
added or removed.

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

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-07-31 14:12:17 +02:00
Kirill Bulatov
a31dba9fc1
Reflect token limit errors and warnings in the assistant panel Send button style (#15529)
When used token count is below 80%, the Send button is displayed as
usual: no tooltip, regular style:


![image](https://github.com/user-attachments/assets/06198869-c49e-4231-b0cb-53b8f678c547)

When it exceeds 80% but below the `max_tokens` threshold, the button
starts to show as a warning, with the corresponding tooltip:

![warning](https://github.com/user-attachments/assets/83b02059-9610-4af7-97c6-9bca14364511)

When it is over the `max_token` threshold, the button starts to show as
an error, with another tooltip:

![error](https://github.com/user-attachments/assets/380d426a-cda9-4479-83e0-e018771291b6)

The buttons are not blocked in any case, in case the token calculation
is wrong, to allow using the assistant panel nonetheless.


Release Notes:

- N/A
2024-07-31 14:37:39 +03:00
Bennet Bo Fenner
380a19fcf2
Revert "assistant panel: Fix entering credentials not updating view" (#15528)
Reverts zed-industries/zed#15527

We broke the assistant panel in the process...

Release Notes:

- N/A
2024-07-31 13:26:27 +02:00
Thorsten Ball
b571bc800d
assistant panel: Fix entering credentials not updating view (#15527)
Co-authored-by: Bennet <bennet@zed.dev>

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-07-31 12:51:41 +02:00
Thorsten Ball
c78ea0df7e
assistant panel: Ensure we prompt for creds when panel is activated (#15524)
Something seems to have broke on `main` in last few days.

Bug was reproducible like this:

- Open assistant panel
- Choose provider that wasn't authenticated
- See auth prompt
- Close the tab (!) in the assistant panel
- Reactivate the assistant panel
- Bug: panel is blank!

This fixes the bug by consolidating the behavior of checking credentials
and showing auth prompt.

Release Notes:

- N/A
2024-07-31 11:48:31 +02:00
Thorsten Ball
d8f7322725
assistant panel: Show provider name in model selector (#15523)
With zed.dev provider becoming more popular, it helps alleviate
confusion when showing not only the model name but also the provider
name.

Release Notes:

- N/A
2024-07-31 11:05:16 +02:00
apricotbucket28
8e6af73784
x11: Do not check hover state on properties change (#15518)
This fixes an issue where the window's hovered state would be incorrect,
causing the cursor not to update because it would think the window
wasn't hovered ([relevant
check](a03beeeb5b/crates/gpui/src/window.rs (L3016-L3017))).

The code here doesn't really seem to make sense, since there's already
the `XinputEnter` and `XinputLeave` events that indicate mouse focus
state on the window. The properties change event wouldn't necessarily
indicate when mouse focus changes.

Thanks @Emc2356 for reporting this on the Discord and helping figure out
the issue!
 
Release Notes:

- Linux: Fixed the cursor sometimes not changing on X11
2024-07-30 19:02:48 -07:00
Marshall Bowers
2b019ff9e2
collab: Add GET /billing/subscriptions endpoint (#15516)
This PR adds a new `GET /billing/subscriptions` endpoint to collab for
retrieving the subscriptions to display on the account settings page.

Release Notes:

- N/A
2024-07-30 21:17:35 -04:00
Marshall Bowers
a08e020e32
extension: Always use a real HTTP client in the ExtensionBuilder (#15514)
This PR makes it so we always construct a real HTTP client in the
`ExtensionBuilder`.

This used to be the case, but was inadvertently changed in
https://github.com/zed-industries/zed/pull/15470.

Release Notes:

- N/A
2024-07-30 18:04:53 -04:00
Marshall Bowers
a7ffc2b6f3
Show current plan in user menu (#15513)
This PR updates the user menu to show the user's current plan.

Also adds a new RPC message to send this information down to the client
when Zed starts.

This is behind a feature flag.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-07-30 17:38:16 -04:00
Marshall Bowers
7c5f4b72fb
collab: Rework Stripe event processing (#15510)
This PR reworks how we process Stripe events for reconciliation
purposes.

The previous approach in #15480 turns out to not be workable, on account
of the Stripe event IDs not being strictly in order. This meant that we
couldn't reliably compare two arbitrary event IDs and determine which
one was more recent.

This new approach leans on the guidance that Stripe provides for
webhooks events:

> Webhook endpoints might occasionally receive the same event more than
once. You can guard against duplicated event receipts by logging the
[event IDs](https://docs.stripe.com/api/events/object#event_object-id)
you’ve processed, and then not processing already-logged events.
>
> https://docs.stripe.com/webhooks#handle-duplicate-events

We now record processed Stripe events in the `processed_stripe_events`
table and use this to filter out events that have already been
processed, so we do not process them again.

When retrieving events from the Stripe events API we now buffer the
unprocessed events so that we can sort them by their `created` timestamp
and process them in (roughly) the order they occurred.

Release Notes:

- N/A
2024-07-30 16:35:11 -04:00
Bennet Bo Fenner
dca9400edf
assistant: Ensure that zed provider is listed as first option (#15496)
Release Notes:

- N/A
2024-07-30 19:38:52 +02:00
Kirill Bulatov
eedef487ac
Add more context to the terminal assistant (#15492)
Release Notes:

- N/A
2024-07-30 20:21:45 +03:00
Jason Lee
1982a5aed1
gpui: Improve img element to support load from Assets (#15482)
Release Notes:

- N/A


Currently, the `img` element provided by GPUI only supports FilePath or
URL, but in actual applications we need to let `img` load an image
embedded in Assets.

The `svg` element can currently support this, but `img` cannot.

For example:

We have such an Assets directory:

```
assets
|- icons
|- images
|--- foo.png
```

```rs
// If give a path, considered an Asset
img("images/foo.png");
// If give a URI, considered a Remote image
img("https://foo.bar/images/foo.png");
// If give a PathBuf, considered a Local file
img(PathBuf::from("path/to/foo.png"));
```


## Example test

```
cargo run -p gpui --example image 
```

<img width="827" alt="image"
src="https://github.com/user-attachments/assets/e45dcf7f-4626-4fb0-aca9-9b6e1045a952">

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-30 10:55:48 -04:00
Antonio Scandurra
99bc90a372
Allow customization of the model used for tool calling (#15479)
We also eliminate the `completion` crate and moved its logic into
`LanguageModelRegistry`.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-30 16:18:53 +02:00
Kirill Bulatov
1bfea9d443
Show "full" paths in the /file command output (#15483)
Same as /tabs command outputs them

Before:
![Screenshot 2024-07-30 at 16 52
11](https://github.com/user-attachments/assets/acf1c79e-4607-41fc-bd5e-b20dc668eff4)

![Screenshot 2024-07-30 at 16 52
03](https://github.com/user-attachments/assets/dd7fa42f-3ba8-4f1c-9420-2a0246df64b7)

After:
![Screenshot 2024-07-30 at 16 53
16](https://github.com/user-attachments/assets/ee866ecb-2142-4303-9385-c6b856310d43)

![Screenshot 2024-07-30 at 16 53
21](https://github.com/user-attachments/assets/d42b9c77-d5e9-4aaf-8de9-3b160078e622)


Release Notes:

- N/A
2024-07-30 17:03:16 +03:00
Marshall Bowers
b160e13f20
collab: Keep track of last seen Stripe event for each record (#15480)
This PR improves our Stripe event handling by keeping track of the last
event we've seen for each record.

The `billing_customers` and `billing_subscriptions` tables both have a
new `last_stripe_event_id` column. When we apply an event to one of
these records, we store the event ID that was applied.

Then, when we are going through events we can ignore any event that has
an ID that came before the `last_stripe_event_id` (based on the
lexicographical ordering of the IDs).

Release Notes:

- N/A
2024-07-30 10:00:16 -04:00
Bennet Bo Fenner
2ada2964c5
assistant: Make it easier to define custom models (#15442)
This PR makes it easier to specify custom models for the Google, OpenAI,
and Anthropic provider:

Before (google):

```json
{
  "language_models": {
    "google": {
      "available_models": [
        {
          "custom": {
            "name": "my-custom-google-model",
            "max_tokens": 12345
          }
        }
      ]
    }
  }
}
```

After (google):

```json
{
  "language_models": {
    "google": {
      "available_models": [
        {
          "name": "my-custom-google-model",
          "max_tokens": 12345
        }
      ]
    }
  }
}
```

Before (anthropic):

```json
{
  "language_models": {
    "anthropic": {
      "available_models": [
        {
          "custom": {
            "name": "my-custom-anthropic-model",
            "max_tokens": 12345
          }
        }
      ]
    }
  }
}
```

After (anthropic):

```json
{
  "language_models": {
    "anthropic": {
      "version": "1",
      "available_models": [
        {
          "name": "my-custom-anthropic-model",
          "max_tokens": 12345
        }
      ]
    }
  }
}

```

The settings will be auto-upgraded so the old versions will continue to
work (except for Google since that one has not been released).

/cc @as-cii 

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-07-30 15:46:39 +02:00
Santeri Salmijärvi
13dcb42c1c
Change PathLikeWithPosition<P> into a non-generic type and replace ad-hoc Windows path parsing (#15373)
This simplifies `PathWithPosition` by making the common use case
concrete and removing the manual, incomplete Windows path parsing.
Windows paths also don't get '/'s replaced by '\\'s anymore to limit the
responsibility of the code to just parsing out the suffix and creating
`PathBuf` from the rest. `Path::file_name()` is now used to extract the
filename and potential suffix instead of manual parsing from the full
input. This way e.g. Windows paths that begin with a drive letter are
handled correctly without platform-specific hacks.

Release Notes:

- N/A
2024-07-30 16:39:33 +03:00
Thorsten Ball
41c550cbe1
assistant panel: Avoid auth prompt on provider switch (#15478)
Previously, the following lead to a bug:

1. Set OpenAI key
2. Switch to Anthropic
3. Restart Zed
4. Switch provider to OpenAI -> get prompted for authentication prompt

With this change, you won't get prompted for the OpenAI key again.

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-07-30 14:25:02 +02:00
Piotr Osiewicz
21ebbc387a
Inline Assist: replace "accept" action on generation error with "restart" (#15476)
Release Notes:

- N/A
2024-07-30 13:40:22 +02:00
Piotr Osiewicz
530feecdaa
tab_switcher: Add support for tab switcher in assistant panel (#15475)
Additionally, I've generalized the implementation of tab switcher so
that - instead of explicitly listing panels it supports (at the time of
writing it was just the terminal panel and nothing else), it now relies
on Panel::pane trait method. As long as that's implemented, you get a
tab switcher support for free.

Release Notes:

- Added support for tab switcher in Assistant panel.
2024-07-30 13:32:13 +02:00
Bennet Bo Fenner
0540291204
settings: Introduce PRESERVED_KEYS to write default values (#15474)
This adds the optional `PRESERVED_KEYS` constant to the `Settings`
trait,
which allows users of the trait to specify which keys should be written
to
the settings file, even if their current value matches the default
value.

That's useful for tagged settings that have, for example, a `"version"`
field
that should always be present in the user settings file, so we can then
reparse
the user settings based on the version.

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

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-07-30 13:09:50 +02:00
Antonio Scandurra
fa19bc98ac
Provide user agent when performing HTTP requests (#15470)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-30 11:12:37 +02:00
Bennet Bo Fenner
2a649fa824
language model: Fix missing use_tool method in CopilotChatLanguageModel (#15466)
Broke CI after merging #14842 

Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-07-30 09:54:42 +02:00
Jason Lee
0c8b17d252
Hide blinking cursor when window is deactivated (#15408)
## Before 

https://github.com/user-attachments/assets/affb8407-a20e-4258-a8f7-b271da5d7b77

## After

https://github.com/user-attachments/assets/654fe7b9-330a-40c8-8885-72e69fa85b0a

Release Notes:

- Hide blinking cursor when window is deactivated ([4710](https://github.com/zed-industries/zed/issues/4710))
2024-07-30 10:49:15 +03:00
Ryan Hawkins
6f0655810e
Add GitHub Copilot Chat Support (#14842)
# Summary

This commit implements Github Copilot Chat support within the existing
Assistant panel/framework. It required a little bit of trickery and
internal API modification, as Copilot doesn't use the same
authentication-style as all of the existing providers, opting to use
OAuth and a short lived API key instead of a straight API key. All
existing Assistant features should work.

Release Notes:
- Added Github Copilot Chat support
([#4673](https://github.com/zed-industries/zed/issues/4673)).

## Screenshots
<img width="1552" alt="A screenshot showing a conversation between a
user and Github Copilot Chat within the Zed editor."
src="https://github.com/user-attachments/assets/73eaf6a2-792b-4c40-a7fe-f763bd6417d7">

---------

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
2024-07-30 09:32:58 +02:00
Marshall Bowers
d93891ba63
collab: Lay groundwork for reconciling with Stripe using the events API (#15459)
This PR lays the initial groundwork for using the Stripe events API to
reconcile the data in our system with what's in Stripe.

We're using the events API over webhooks so that we don't need to stand
up the associated infrastructure needed to handle webhooks effectively
(namely an asynchronous job queue).

Since we haven't configured the Stripe API keys yet, we won't actually
spawn the reconciliation background task yet, so this is currently a
no-op.

Release Notes:

- N/A
2024-07-29 23:50:07 -04:00
Marshall Bowers
28c14cdee4
collab: Add separate billing_customers table (#15457)
This PR adds a new `billing_customers` table to hold the billing
customers.

Previously we were storing both the `stripe_customer_id` and
`stripe_subscription_id` in the `billable_subscriptions` table. However,
this creates problems when we need to correlate subscription events back
to the subscription record, as we don't know the user that the Stripe
event corresponds to.

By moving the `stripe_customer_id` to a separate table we can create the
Stripe customer earlier in the flow—before we create the Stripe Checkout
session—and associate that customer with a user. This way when we
receive events down the line we can use the Stripe customer ID to
correlate it back to the user.

We're doing some destructive actions to the `billing_subscriptions`
table, but this is fine, as we haven't started using them yet.

Release Notes:

- N/A
2024-07-29 22:48:21 -04:00
Marshall Bowers
66121fa0e8
collab: Add endpoint for managing a billing subscription (#15455)
This PR adds a new `POST /billing/subscriptions/manage` endpoint that
can be used to manage a billing subscription.

The endpoint accepts a `github_user_id` to identify the user, as well as
an optional `subscription_id` for managing a specific subscription. If
`subscription_id` is not provided, it try and use the active
subscription, if there is only one.

Right now the endpoint only supports cancelling an active subscription.
This is done by passing `"intent": "cancel"` in the request body.

The endpoint will return the URL to a Stripe customer portal session,
which the caller can redirect the user to.

Here's an example of how to call it:

```sh
curl -X POST "http://localhost:8080/billing/subscriptions/manage" \
     -H "Authorization: <ADMIN_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{"github_user_id": 12345, "intent": "cancel"}'
```

Release Notes:

- N/A
2024-07-29 20:05:17 -04:00
Marshall Bowers
e15d59c445
collab: Add endpoint for initiating a billing subscription (#15452)
This PR adds a new `POST /billing/subscriptions` endpoint that can be
used to initiate a billing subscription.

The endpoint will use the provided `github_user_id` to look up a user,
generate a Stripe Checkout session, and then return the URL.

The caller would then redirect the user to the URL to initiate the
checkout flow.

Here's an example of how to call it:

```sh
curl -X POST "http://localhost:8080/billing/subscriptions" \
     -H "Authorization: <ADMIN_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{"github_user_id": 12345}'
```

Release Notes:

- N/A
2024-07-29 17:31:36 -04:00
Kyle Kelley
8bb34fd93e
repl: Log Jupyter kernel process stderr and stdout (#15391)
Super simple piping of logs from the Jupyter kernels to the Zed logs.

Release Notes:

- Added logging of stderr from Jupyter kernels to the Zed logs
2024-07-29 14:23:35 -07:00
Antonio Scandurra
02c51c9b56
Fix rendering of focused offscreen block when scrolled to bottom (#15449)
This change fixes a bug when a block is focused but offscreen.
Previously, we used the last row, but this caused a spurious block to be
rendered when scrolled to the end of the file. With this change we
always render off-screen blocks below the editor's clipping box.

Release Notes:

- Fixed a bug that caused the inline assistant to be displayed twice in
certain circumstances.

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-29 20:39:21 +02:00
Marshall Bowers
085d41b121
collab: Add billing_subscriptions table (#15448)
This PR adds a new `billing_subscriptions` table to the database, as
well as some accompanying models/queries.

In this table we store a minimal amount of data from Stripe:

- The Stripe customer ID
- The Stripe subscription ID
- The status of the Stripe subscription

This should be enough for interactions with the Stripe API (e.g., to
[create a customer portal
session](https://docs.stripe.com/api/customer_portal/sessions/create)),
as well as determine whether a subscription is active (based on the
`status`).

Release Notes:

- N/A
2024-07-29 14:32:13 -04:00
Joseph T. Lyons
0702ed5cd6
Add is_staff and destination to download events (#15445)
Release Notes:

- N/A
2024-07-29 14:21:29 -04:00
Antonio Scandurra
2b871a631a
Use fuzzy-matching to locate symbols when resolving edit steps (#15447)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-29 20:21:19 +02:00
Michael Angerman
5e1aa898d4
workspace: Remove unused code (#15440)
Release Notes:

- N/A
2024-07-29 12:12:10 -04:00
Marshall Bowers
aa1633ba40
assistant: Allow guests to create new contexts on the host (#15439)
This PR extends collaboration in the Assistant to allow guests to create
new contexts on the host when collaborating.

Release Notes:

- N/A
2024-07-29 12:01:09 -04:00
Thorsten Ball
2b0c60043d
file finder: Fix ./ breaking new-path prompt (#15438)
Fixes #15426.

The `./` was implicitly assumed to be there by the prompt, so we'd end
up with `././foobar` when typing in an explicit `./`.

This fixes the issue by stripping `./` from the query, like we also
strip `/`.

Release Notes:

- Fixed paths starting with `./` breaking the new-path file picker when
the system prompts are disabled.
([#15426](https://github.com/zed-industries/zed/issues/15426)).
2024-07-29 17:46:52 +02:00
Bennet Bo Fenner
0b4afe518b
assistant: Remove feature flag for terminal inline assistant (#15432)
This PR removes the feature flag for the terminal inline assistant,
making it available to everyone.

Release Notes:

- Use Ctrl+Enter to summon the inline assistant in the terminal, which
let's you generate terminal commands based on your description
([demo](https://twitter.com/thorstenball/status/1814241447383605329))
2024-07-29 17:37:11 +02:00
Suhun Han
f124ca6474
project_panel: Double-click on blank space in project panel to create a new file (#15353)
Similar feature implemented in VSCode.


https://github.com/user-attachments/assets/ae250b5f-283c-4211-8947-d5d5703eb2d0


Release Notes:

- Added double-click to create a new file when clicking on blank space
in the project panel.
2024-07-29 18:33:13 +03:00
Conrad Irwin
6db33b83d8
vim: Fix >... (#15404)
Co-Authored-By: @Alextopher

Release Notes:

- vim: Fixed a hang when repeating an aborted operation
([#15399](https://github.com/zed-industries/zed/issues/15399)).
2024-07-29 09:22:25 -06:00
Thorsten Ball
f58ef9b82b
zed: Persist window stack order across restarts (#15419)
This changes the workspace/session serialization to also persist the
order of windows across restarts.

Release Notes:

- Improved restoring of windows across restarts: the order of the
windows is now also restored. That means windows that were in the
foreground when Zed was quit will be in the foreground after restart.
(Right now only supported on Linux/X11, not on Linux/Wayland.)

Demo:



https://github.com/user-attachments/assets/0b8162f8-f06d-43df-88d3-c45d8460fb68
2024-07-29 17:05:56 +02:00
Antonio Scandurra
6e1f7c6e1d
Use tool calling instead of XML parsing to generate edit operations (#15385)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-29 16:42:08 +02:00
Bennet Bo Fenner
f6012cd86e
assistant: Improve discoverability of terminal inline assist (#15431)
This adds a button to the terminal tab bar:

<img width="444" alt="image"
src="https://github.com/user-attachments/assets/71baadae-0ecf-493f-853c-34d4d6a48310">


Release Notes:

- N/A
2024-07-29 15:38:25 +02:00
earomc
1a9af10ca2
rust: Add highlight selector for doc comments (#15384)
## Release Notes:

- Added ability to style doc comments in Rust separately with
`comment.doc`
([#15322](https://github.com/zed-industries/zed/issues/15322)).


Just required adding another query to the highlights.scm file. Took
inspiration from the tree-sitter-rust repository
[here](https://github.com/tree-sitter/tree-sitter-rust/blob/master/queries/highlights.scm)

#### Doc comments customized in the theme are working now:

![grafik](https://github.com/user-attachments/assets/549f20d6-534c-4c3b-a317-3be6bc44352e)

#### Snippet from the .json theme file

![grafik](https://github.com/user-attachments/assets/da1d7e3d-b6a5-4ba5-9fef-047d69f9ea03)
2024-07-29 08:53:17 -04:00
Piotr Osiewicz
c97d035eea
chore: Clean up allocs around project panel (#15422)
A drive-by I did when looking at something else.

Release Notes:

- N/A
2024-07-29 14:21:41 +02:00
Ephram
78a2539d59
Selectable diagnostic popover text (#14518)
Release Notes:

- Added the ability to select and copy text from diagnostic popovers

- Fixed #12695




https://github.com/user-attachments/assets/b896bacf-ecbc-48f5-8228-a3821f0b1a4e

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-07-28 23:13:13 -06:00
Conrad Irwin
583b6235fb
SSH remoting: terminal & tasks (#15321)
This also rolls back the `TerminalWorkDir` abstraction I added for the
original remoting, and tidies up the terminal creation code to be clear
about whether we're creating a task *or* a terminal. The previous logic
was a little muddy because it assumed we could be doing both at the same
time (which was not true).

Release Notes:

- remoting alpha: Removed the ability to specify `gh cs ssh` or `gcloud
compute ssh` etc. See https://zed.dev/docs/remote-development for
alternatives.
- remoting alpha: Added support for terminal and tasks to new
experimental ssh remoting
2024-07-28 22:45:00 -06:00
Benjamin Davies
26d0a33e79
Add Vim digraphs (#14887)
Vim digraphs are a way to insert special characters using sequences of
two ASCII characters. I've implemented the feature using a new `Digraph`
operator, following the example of `AddSurrounds`. There are still a few
issues that I'm not sure what the best way to resolve them is.

- To insert `ş`, the user must pause between pressing `ctrl-k` and `s
,`, otherwise it triggers the binding for `ctrl-k s`. Is there a way to
disable `ctrl-k *` bindings while in insert, replace or waiting mode?
- Is there a better way to insert a string at all of the cursors? At the
moment I'm constructing the edits manually.
- The table of default digraphs is a 1.4k line rust expression. Is this
okay as long as it's in its own module?
- I'd like a second opinion on how best to structure the settings.json
entry.
- I have omitted the "meta character" feature as I don't think it makes
sense when editing UTF-8 text.

Release Notes:

- Added support for Vim digraphs.

Resolves #11871
2024-07-28 22:44:32 -06:00
Michael Angerman
b87028956f
Remove the file session.rs in crate/zed which is no longer used (#15394)
There was an empty file *session.rs* in the crate zed which was empty so
I am going ahead and removing it...

Release Notes:

- N/A
2024-07-28 21:32:03 -04:00
Piotr Osiewicz
a875dd153d
lsp: Add server-side tracing support (#15230)
This PR adds another row to the LSP log view: Server traces

![image](https://github.com/user-attachments/assets/e3f77944-45e0-4d04-92fd-aea212859e86)


[Traces](https://docs.rs/lsp-types/latest/lsp_types/notification/enum.LogTrace.html)
are intended for logging execution diagnostics, which is different from
`LogMessage` that we currently support.
When `Server trace` is selected, user can select the level of tracing
(`off`/`messages`/`verbose`) to their liking.

Release Notes:

- Added support for language server tracing to the LSP log view.
2024-07-29 01:53:30 +02:00
Kyle Kelley
bb188f673e
repl: Pass session id to kernel connections (#15389)
Updated runtimelib to 0.14 and passed a kernel session ID through to
identify our client.

Release Notes:

- N/A
2024-07-28 14:37:25 -07:00
Peter Tripp
49f87165ea
Show -v verbose flag in go test task label (#15375) 2024-07-28 11:48:40 -04:00
CharlesChen0823
66ada3e44c
terminal: Add Alt key bindings for terminal (#14556)
- Makes using emacs-style alt/option/meta key shortcuts work in terminal (e.g. `M-%`)
- Fixes: #14543 

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-07-28 09:42:17 -04:00
Antonio Scandurra
d6bdaa8a91
Simplify LLM protocol (#15366)
In this pull request, we change the zed.dev protocol so that we pass the
raw JSON for the specified provider directly to our server. This avoids
the need to define a protobuf message that's a superset of all these
formats.

@bennetbo: We also changed the settings for available_models under
zed.dev to be a flat format, because the nesting seemed too confusing.
Can you help us upgrade the local provider configuration to be
consistent with this? We do whatever we need to do when parsing the
settings to make this simple for users, even if it's a bit more complex
on our end. We want to use versioning to avoid breaking existing users,
but need to keep making progress.

```json
"zed.dev": {
  "available_models": [
    {
      "provider": "anthropic",
        "name": "some-newly-released-model-we-havent-added",
        "max_tokens": 200000
      }
  ]
}
```

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-28 11:07:10 +02:00
Antonio Scandurra
e0fe7f632c
Restore "Avoid buffering line content to compute indent guides" (#15284)
Fixes https://github.com/zed-industries/zed/issues/15218
Reverts zed-industries/zed#15282

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-28 10:52:39 +02:00
apricotbucket28
04e25525bf
x11: Fix window menu not showing (#15328)
Fixes
https://github.com/zed-industries/zed/issues/15245#issuecomment-2252790889

Release Notes:

- Linux: Fixed window menu not showing on X11
2024-07-27 12:29:48 -07:00
Marshall Bowers
26aec4ba99
ui: Remove old settings components (#15347)
This PR removes the old settings components, as they've been adapted
into other components for the settings UI.

Release Notes:

- N/A
2024-07-27 14:12:32 -04:00
Marshall Bowers
cb07e02ce9
ui: Apply elevation outside SettingsContainer (#15346)
This PR changes the `SettingsContainer` component such that the
elevation styles are applied by the parent instead of
`SettingsContainer` itself.

This means that components using `SettingsContainer` can be embedded in
different contexts, like the settings UI or a popover containing the
settings.

Release Notes:

- N/A
2024-07-27 14:00:03 -04:00
Harsh Narayan Jha
b05d532991
Add "Copy Path" and "Copy Relative Path" items into tab context menu (#15260)
Release Notes:

- Added "Copy Path" and "Copy Relative Path" items into tab context menu ([#13970](https://github.com/zed-industries/zed/issues/13970))

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-07-27 20:29:53 +03:00
张小白
f88278111e
Remove TODO in JsonLspAdapter (#15338)
As the post-install issue is fixed via #15331 , we can remove this
`TODO` now. I have tested on win11, it works fine.

Release Notes:

- N/A
2024-07-27 13:05:48 -04:00
Marshall Bowers
f1d777434b
ui: Give NumericSteppers an ID (#15344)
This PR gives the `NumericStepper` component an ID.

This prevents the UI and buffer font size settings controls from having
their increment/decrement buttons visually change when the other one is
pressed.

Release Notes:

- N/A
2024-07-27 13:02:27 -04:00
Marshall Bowers
b8982ad385
Factor out construction of font-related JSON schemas (#15341)
This PR factors out the construction of the font-related JSON schemas,
as they were used in multiple places.

Release Notes:

- N/A
2024-07-27 12:28:50 -04:00
Marshall Bowers
1ffb34c5fc
Fix more instances of JSON schema getting clobbered when attaching references (#15339)
This PR extends the fix from #15336 to more places that had the same
issue.

An `add_references_to_properties` helper function has been added to
handle these cases uniformly.

Release Notes:

- N/A
2024-07-27 11:44:40 -04:00
Marshall Bowers
8b22f09b6f
Don't clobber other schema fields when attaching references (#15336)
This PR fixes an issue where we would clobber the other JSON Schema
fields for any field that we attached a reference to.

This resulted in these fields (e.g., `buffer_font_family`,
`ui_font_family`) losing things like their descriptions.

The approach has been adjusted that references are now added in an
additive fashion, rather than overriding the entire schema object.

Release Notes:

- Fixed an issue where font-related settings in `settings.json` were
missing their descriptions.
2024-07-27 11:08:13 -04:00
Nick Cernis
e72f33d79e
Fix typo in remote projects sign-in prompt (#15325)
Visible at File → Open Recent → Open Remote Folder…

| Before | After |
| - | - |
| ![Screenshot showing
"featuers"](https://github.com/user-attachments/assets/6e1822c7-74da-4166-a097-ab2315fddd1a)
| ![Corrected
"features"](https://github.com/user-attachments/assets/038380a6-15c1-4c71-ad47-ddd477094d85)
|

Release Notes:

- Fixed typo in remote projects sign-in prompt.
2024-07-27 10:34:48 -04:00
张小白
4976a9e9d8
windows: Fix eslint installation (#15331)
Close #13786. To make `eslint` running on Windows, I made the following
changes:

1. Ensure that `zed` downloads the `.zip` file.
2. Handle the `$shared` symbolic link by copying files to the link
location.
3. In #13891, I mentioned that the `npm` `post-install` script was
always failing. After debugging, I found it was due to missing
environment variables. This has been fixed, and I will submit a new PR
to address the changes in #13891.

With this PR, `eslint` can now successfully run on Windows. Video:



https://github.com/user-attachments/assets/e85451b8-0388-490a-8a75-01c12d744f7c



Release Notes:

- Fixed `eslint` not running on Windows
([#13786](https://github.com/zed-industries/zed/issues/13786)).

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-27 10:24:05 -04:00
Marshall Bowers
138c3fcfdd
http_client: Replace build_tarball_url with a more extensible function (#15332)
This PR replaces the `build_tarball_url` with `build_asset_url` that
accepts an `AssetKind` enum to support downloading different kinds of
assets from GitHub.

Right now the only asset kind we support is still `.tar.gz`, but the new
structure is more amenable to adding more asset kinds.

Release Notes:

- N/A
2024-07-27 10:00:45 -04:00
Antonio Scandurra
64add2f222
Add debugging info when a symbol is not found (#15330)
Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-27 15:17:36 +02:00
Antonio Scandurra
70e895a8c7
Fix regression that caused Anthropic custom models to error (#15329)
/cc: @bennetbo 

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-07-27 14:45:18 +02:00
Matin Aniss
4bd935b409
gpui: Add support for animated images (#13809)
This PR adds support for animated images. The image requires a id for it
to actually animate across frames.

Currently it only has support for `GIF`, I tried adding decoding a
animated `WebP` into frames but it seems to error. This issue in the
image crate seems to document this
https://github.com/image-rs/image/issues/2263.

Not sure if this is the best way or the desired way for animated images
to work in GPUI but I would really like support for animated images.
Open to feedback.

Example Video:


https://github.com/zed-industries/zed/assets/76515905/011f790f-d070-499b-96c9-bbff141fb002



Closes https://github.com/zed-industries/zed/issues/9993

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Nathan <nathan@zed.dev>
2024-07-27 14:05:37 +02:00
Marshall Bowers
c0df1e1846
Run clippy for Windows (#15318)
This PR fixes running clippy on Windows, as it broke in #13223.

We can't run shell scripts on Windows, so we need to use something else.

Release Notes:

- N/A
2024-07-26 21:38:34 -04:00
rimuy
e9d0768e3c
Suppress unused parameter warning on remote/ssh_session.rs (#15315)
This was probably an oversight from
https://github.com/zed-industries/zed/pull/15129.


![image](https://github.com/user-attachments/assets/5867e307-f581-4b40-8492-2fb80e87c18c)

Release Notes:

- N/A
2024-07-26 21:11:28 -04:00
Marshall Bowers
380a99038b
live_kit_server: Re-remove protocol submodule (#15317)
This PR re-removes the `protocol` submodule from `live_kit_server`,
since it was incorrectly added back in #15313.

Release Notes:

- N/A
2024-07-26 21:10:56 -04:00
apricotbucket28
88653c4e3e
linux: Respect window_min_size property (#15314)
https://github.com/zed-industries/zed/pull/13126 added the
`window_min_size` property for window creation, but it was only
implemented for macOS. This PR implements the property on Linux as well.

Release Notes:

- N/A
2024-07-26 18:02:31 -07:00
Calin Martinconi
3751f67730
fix: Typos (#15313)
Fixed typos in the code base according with output from `codespell`
tool.

Release Notes:

- N/A
2024-07-26 17:52:37 -07:00
张小白
6af385c09e
windows: Fix some weird IME window panic (#15286)
Previously, we used messages greater than `WM_USER` to pass information
between `WindowsPlatform` and `WindowsWindow`. For example, to close a
window, we handled it as follows:
1. The window sends a message with `WM_USER + 2` to `WindowsPlatform`.
2. `WindowsPlatform`, upon receiving this message, casts the `lparam` to
`HWND` and closes the window.

According to Microsoft's documentation, it is safe to use values between
`WM_USER` and `0xBFFF` as messages. However, certain versions of
Microsoft's IME use `WM_USER + 2` for UNKNOWN purposes. This causes step
2 to be erroneously triggered. The IME window's `lparam` value could be
arbitrary, leading to an attempt to close an arbitrary `HWND` and
resulting in errors.

It is quite surprising that Microsoft indicates using `WM_USER + 2` is
safe, yet Microsoft itself breaks this convention. I mean, well done
Microsoft!

This PR addresses the issue by using the `wparam` with a specific random
value for validation purpose when sending the aforementioned message.
Before `WindowsPlatform` attempts to close the window, it will first
verify the `wparam` value.

Special thanks to @shenjackyuanjie for helping me on this.


Co-authored-by: shenjackyuanjie <3695888@qq.com>


Release Notes:

- Fixed weird panic when IME window is closing(#15185, #12563).

---------

Co-authored-by: shenjack <3695888@qq.com>
2024-07-26 17:40:55 -07:00
张小白
e6cd1cf22b
windows: Remove Send and Sync implementation of DirectWrite (#15263)
This PR uses the `AgileReference` provided by the `windows-rs` crate to
correctly implement `Send` and `Sync` for `DirectWrite`.

Release Notes:

- N/A
2024-07-26 16:46:06 -07:00
Mikayla Maki
a1bd7a1297
Feature/fallback fonts (#15306)
Supersedes https://github.com/zed-industries/zed/pull/12090

fixes #5180
fixes #5055

See original PR for an example of the feature at work.

This PR changes the settings interface to be backwards compatible, and
adds the `ui_font_fallbacks`, `buffer_font_fallbacks`, and
`terminal.font_fallbacks` settings.

Release Notes:

- Added support for font fallbacks via three new settings:
`ui_font_fallbacks`, `buffer_font_fallbacks`, and
`terminal.font_fallbacks`.(#5180, #5055).

---------

Co-authored-by: Junkui Zhang <364772080@qq.com>
2024-07-26 16:42:21 -07:00
Conrad Irwin
3e31955b7f
SSH remote ui (#15129)
Still TODO:
* [x] hide this UI unless you have some ssh projects in settings
* [x] add the "open folder" flow with the new open picker
* [ ] integrate with recent projects / workspace restoration

Release Notes:

- N/A
2024-07-26 16:45:44 -06:00
Conrad Irwin
be86852f95
Allow binding to motions in insert mode (#15308)
Release Notes:

- vim: Allow binding motions in insert mode
2024-07-26 16:33:31 -06:00
Marshall Bowers
bde02a350e
settings_ui: Add line number settings controls (#15310)
This PR adds settings controls for the line numbers and relative line
numbers settings.

Release Notes:

- N/A
2024-07-26 18:31:45 -04:00
Conrad Irwin
c8bc49fa18
vim: Fix count in visual indent (#15296)
Co-Authored-By: tobbe@tlundberg.com

Release Notes:

- vim: Added {count} for `>`/`<` in visual mode
2024-07-26 16:03:41 -06:00
Marshall Bowers
bcd972fbb4
Upgrade dashmap to v6 (#15305)
This PR upgrades `dashmap` to v6.0.1.

Release Notes:

- N/A
2024-07-26 17:58:37 -04:00
Marshall Bowers
e423f03ba6
Upgrade base64 to v0.22 (#15304)
This PR upgrades the `base64` dependency to v0.22.

Supersedes #15300.

Release Notes:

- N/A
2024-07-26 17:40:38 -04:00
Marshall Bowers
03ebbcbef6
live_kit_server: Replace jwt with jsonwebtoken (#15302)
This PR replaces `live_kit_server`'s usage of `jwt` with `jsonwebtoken`.

`jwt` hasn't been updated in 2 years and seems unmaintained.

`jsonwebtoken` has significantly more downloads and appears to be a
healthier crate overall.

Release Notes:

- N/A
2024-07-26 17:20:01 -04:00
Marshall Bowers
27f97ba762
settings_ui: Add font ligature settings controls (#15301)
This PR adds settings controls for changing whether ligatures are
enabled for the UI and buffer fonts.

Release Notes:

- N/A
2024-07-26 17:06:14 -04:00
renovate[bot]
f4bbbe69b4
Update Rust crate waker-fn to v1.2.0 (#15289)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [waker-fn](https://togithub.com/smol-rs/waker-fn) | dependencies |
minor | `1.1.0` -> `1.2.0` |

---

### Release Notes

<details>
<summary>smol-rs/waker-fn (waker-fn)</summary>

###
[`v1.2.0`](https://togithub.com/smol-rs/waker-fn/blob/HEAD/CHANGELOG.md#Version-120)

[Compare
Source](https://togithub.com/smol-rs/waker-fn/compare/v1.1.1...v1.2.0)

-   Add a new `portable-atomic` feature that allows for the usage of the
`portable-atomic` crate to implement `waker-fn`.
([#&#8203;10](https://togithub.com/smol-rs/waker-fn/issues/10))

###
[`v1.1.1`](https://togithub.com/smol-rs/waker-fn/blob/HEAD/CHANGELOG.md#Version-111)

[Compare
Source](https://togithub.com/smol-rs/waker-fn/compare/v1.1.0...v1.1.1)

- Reimplement using 100% safe code.
([#&#8203;7](https://togithub.com/smol-rs/waker-fn/issues/7))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MzguMCIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-26 13:05:29 -04:00
Marshall Bowers
c937a2fcdd
ui: Add functions for generating textual representations of key bindings (#15287)
This PR adds some helper functions in the `ui` crate that can be used to
get textural representations of keystrokes or key bindings.

Release Notes:

- N/A
2024-07-26 12:52:59 -04:00
Nate Butler
a5279cc48a
Tool bar: Remove tool grouping for clarity (#15285)
This PR makes the spacing between items in the tool bar (quick action
bar) consistent vs grouped by type. The idea was to add clarity to the
types of tools, but we haven't built this system out enough for these
groupings to be recognizable. So for now, let's make the spacing
consistent.

Before:
![CleanShot 2024-07-26 at 11 58
22@2x](https://github.com/user-attachments/assets/9135fcce-fcf8-4bdf-a71b-6d6c7e5b3f63)


After:

![CleanShot 2024-07-26 at 11 57
02@2x](https://github.com/user-attachments/assets/0aceb981-01b6-466f-8d7e-97b564d014f9)

Release Notes:

- N/A
2024-07-26 12:36:49 -04:00
CharlesChen0823
4d56252bae
linux: Allow skipping "Unsupported GPU" warning (#15271)
I just want using Zed in virtual machine, current implement must read
code and set env `ZED_ALLOW_EMULATED_GPU` then can work.

Release Notes:

- N/A
2024-07-26 10:26:14 -06:00
Thorsten Ball
0360cda543
tasks: Use environment variables from project (#15266)
This fixes #12125 and addresses what's described in here:

-
https://github.com/zed-industries/zed/issues/4977#issuecomment-2162094388

Before the changes in this PR, when running tasks, they inherited the
Zed process environment, but that might not be the process environment
that you'd get if you `cd` into a project directory.

We already ran into that problem with language servers and we fixed it
by loading the shell environment in the context of a projects root
directory and then passing that to the language servers when starting
them (or when looking for their binaries).

What the change here does is to add the behavior for tasks too: we use
the project-environment as the base environment with which to spawn
tasks. Everything else still works the same, except that the base env is
different.

Release Notes:

- Improved the environment-variable detection when running tasks so that
tasks can now access environment variables as if the task had been
spawned in a terminal that `cd`ed into a project directory. That means
environment variables set by `direnv`/`asdf`/`mise` and other tools are
now picked up.
([#12125](https://github.com/zed-industries/zed/issues/12125)).

Demo:


https://github.com/user-attachments/assets/8bfcc98f-0f9b-4439-b0d9-298aef1a3efe
2024-07-26 18:19:53 +02:00
Danilo Leal
5e04753d1c
Add note about used context in the model selector (#15235)
When pressing <kbd>control</kbd> + <kbd>enter</kbd>, the AI-powered
inline transformation input displays an icon button and a token count,
which should show roughly the same numbers you'd see on your assistant
panel. At a first glance, though, the token count not being zero can be
confusing, where you'd wonder where that's coming from. That's because
the inline input uses whatever piece of context and/or information of
the currently selected assistant tab to suggest more accurate edits.

So, this PR introduces an informative piece of text to the
`ModelSelector` menu, on the inline transformation input, which delivers
exactly this bit of info, aimed at clarifying the connection between
these two methods of interacting with LLMs.

I've also took the opportunity to change the icon button's icon to one
that's a bit easier to see, still representing the affordance of "click
to configure something".

Release Notes:

- Add note about how inline edits consume context from the assistant
panel to clarify interaction with LLMs.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-26 12:48:06 -03:00
Nate Butler
05825e9804
Add Markdown Preview Toggle (#15215)
Add a "Preview Markdown" button to the quick action bar when in a
markdown editor.

While it isn't my favorite, I went with the basic eye icon to be a bit
more generic so we can extend this control to allow opening other
previews such as SVGs like @jansol mentioned.

![CleanShot 2024-07-26 at 11 02
16@2x](https://github.com/user-attachments/assets/415963ce-d19e-432d-b8c2-37e7c6e52683)


https://github.com/user-attachments/assets/5980272c-eab9-4f69-86b6-0c593c25b525

---

Release Notes:

- Added a button to preview Markdown files in the toolbar.
`Option|Alt+Click` will open the preview to the side.
2024-07-26 11:08:42 -04:00
Antonio Scandurra
e59e47fe7f
Revert "Avoid buffering line content to compute indent guides" (#15282)
Reverts zed-industries/zed#15167

Release Notes:

- N/A
2024-07-26 11:05:24 -04:00
Marshall Bowers
4abf7f058e
Upgrade env_logger to v0.11 (#15278)
This PR upgrades `env_logger` to v0.11.

There were some breaking changes in the style API. I followed the
[migration
guide](73bb418802/CHANGELOG.md (migration-guide))
to update the usage.

Visually there shouldn't be any changes:

### Before

<img width="1068" alt="Screenshot 2024-07-26 at 10 20 07 AM"
src="https://github.com/user-attachments/assets/9abdbba2-5a34-46df-a62b-3d6c2d9d1137">

### After

<img width="1061" alt="Screenshot 2024-07-26 at 10 37 35 AM"
src="https://github.com/user-attachments/assets/c81bc3cc-1738-43f7-ba19-4c4be058427f">

Release Notes:

- N/A
2024-07-26 10:48:07 -04:00
Kirill Bulatov
243fb3562c
Auto fold directories in the project panel by default (#15273) 2024-07-26 15:26:20 +03:00
Kirill Bulatov
e830865eb1
Return an empty measurement instead of panicking (#15269)
Follow-up of https://github.com/zed-industries/zed/pull/15256

Returns zero size for no items to render.

Incorrect worktree state made the uniform list to have 0 items to
render, so
```Rust
let mut items = (self.render_items)(item_ix..item_ix + 1, cx);
let mut item_to_measure = items.pop().unwrap();
```
panicked as the first line returned an empty array despite a
single-element range provided.


Release Notes:

- N/A
2024-07-26 14:21:09 +03:00
CharlesChen0823
7aa6f4788d
regression: Fix a panic when removing git-containing worktree from the project panel (#15256)
Follow-up of #14989

Opening a project with git metadata and clicking "Remove from Project" will panic:
![image](https://github.com/user-attachments/assets/ba00dc55-d299-4edc-9a1f-01e92f0dd9ca)

Release Notes:

- N/A
2024-07-26 14:20:59 +03:00
Thorsten Ball
18daf17d0e
refactoring: Use helper instead of adjusting selection manually (#15262)
I added `newest_adjusted` recently and now just bumped into the old code
that didn't use it.

Release Notes:

- N/A
2024-07-26 11:12:33 +02:00
Joseph T. Lyons
856d9632e4
Add repl events (#15259)
Release Notes:

- N/A

---------

Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-07-26 03:31:41 -04:00
Marshall Bowers
745d2e4d3b
collab: Extract contributor endpoints to their own module (#15251)
This PR extracts the contributor endpoints to their own module for
organizational purposes.

Release Notes:

- N/A
2024-07-25 23:02:32 -04:00
Marshall Bowers
50dbab0747
collab: Add renovate[bot] to the GET /contributor endpoint (#15250)
This PR adds the `renovate[bot]` user to the `GET /contributor` endpoint
so that it passes the CLA check.

I patched this temporarily by adding a case into the `zed.dev` endpoint
the fronts this one, but I think long-term it will be better for collab
to be the source of truth.

Release Notes:

- N/A
2024-07-25 22:52:59 -04:00
Marshall Bowers
05003ed4c5
Hoist strum to workspace level (#15243)
This PR hoists `strum` up to a workspace dependency.

Release Notes:

- N/A
2024-07-25 21:30:48 -04:00
Marshall Bowers
479ffbbd51
ui: Make Label respect the ui_font_weight setting (#15241)
This PR makes the `Label` component respect the `ui_font_weight`
setting, by default.

An explicit font weight can still be set via the `weight` method, which
will override the `ui_font_weight` for that `Label`.

<img width="1566" alt="Screenshot 2024-07-25 at 8 55 16 PM"
src="https://github.com/user-attachments/assets/2751e29c-c76e-4685-8564-604b3b77f603">

Release Notes:

- Updated UI labels to respect the `ui_font_weight` setting
([#15234](https://github.com/zed-industries/zed/issues/15234)).
2024-07-25 21:08:28 -04:00
Marshall Bowers
95d82f88de
ui: Make custom rows in ContextMenus use a normal cursor (#15239)
This PR makes custom rows in `ContextMenu`s use a regular cursor instead
of a pointer.

Even though custom rows were marked as not selectable, we would still
pass a click handler to them, causing the `ListItem` to show a pointer
cursor.

Release Notes:

- N/A
2024-07-25 20:16:53 -04:00
Marshall Bowers
02c43a5bf2
Add missing workspace lints (#15237)
This PR adds the missing workspace lint configuration for the following
crates that were missing it:

- `google_ai`
- `open_ai`
- `tab_switcher`

Release Notes:

- N/A
2024-07-25 19:52:24 -04:00
Piotr Osiewicz
ec5886a078
rust: Add static items to the outline (#15225)
Fixes #15208
Release Notes:

- Outline panel for Rust files now includes static items.
2024-07-26 00:52:42 +02:00
Kirill Bulatov
10c9e337cf
Fix more gutter close button alignment issues (#15233)
Follow-up of https://github.com/zed-industries/zed/pull/15178

* shows proper cursor on hovering a block that's over a git hunk
* show gutter buttons better when git hunks are on the same line
* show deleted hunks' gutter buttons better when git blame info is shown
in the gutter

Release Notes:

- N/A
2024-07-26 01:42:25 +03:00
Marshall Bowers
1da6a12bb4
Upgrade scrypt to v0.11 (#15228)
This PR upgrades `scrypt` to v0.11.

There were some API changes that impacted our usage just in the tests.

Supersedes #15224.

Release Notes:

- N/A
2024-07-25 17:45:24 -04:00
Piotr Osiewicz
0d5de88c4b
chore: Bump Rust version to 1.80 (#15186)
Release Notes:

- N/A
2024-07-25 22:48:42 +02:00