Commit graph

22626 commits

Author SHA1 Message Date
Marshall Bowers
3f2de172ae
collab: Set cached token values when initially creating lifetime usage records (#18865)
This PR fixes an issue where we weren't setting the cached token fields
when initially creating a lifetime usage record.

Release Notes:

- N/A
2024-10-08 13:16:17 -04:00
Joseph T. Lyons
77bf2ad0f1
Add is_via_ssh field to edit events (#18867)
Release Notes:

- N/A
2024-10-08 13:13:40 -04:00
Marshall Bowers
3da1902e24
worktree: Depend on rpc with test-support feature in tests (#18866)
This PR updates the `worktree` crate to depend on `rpc` with the
`test-support` feature flag when running tests.

This fixes an issue I was seeing locally when trying to run tests in the
`worktree` crate:

```
λ cargo test -p worktree -- test_repository_subfolder_git_status
   Compiling worktree v0.1.0 (/Users/maxdeviant/projects/zed/crates/worktree)
error[E0432]: unresolved import `rpc::AnyProtoClient`
  --> crates/worktree/src/worktree.rs:39:18
   |
39 | use rpc::{proto, AnyProtoClient};
   |                  ^^^^^^^^^^^^^^ no `AnyProtoClient` in the root

For more information about this error, try `rustc --explain E0432`.
error: could not compile `worktree` (lib test) due to 1 previous error
```

Release Notes:

- N/A
2024-10-08 13:07:34 -04:00
Max Brunsfeld
4139e2de23
In proposed change editors, apply diff hunks in batches (#18841)
Release Notes:

- N/A
2024-10-08 08:58:28 -07:00
Thorsten Ball
ff7aa024ee
remote server on macOS: Sign with entitlements (#18863)
This does two things:

- Prevent feature unification
- Sign the remote-server binary with the same entitlements we use for
Zed because we saw this in crash report:

Crashed Thread: 4 Dispatch queue: com.apple.root.user-initiated-qos

Exception Type: EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
      Exception Codes:       UNKNOWN_0x32 at 0x0000000103636644
      Exception Codes:       0x0000000000000032, 0x0000000103636644

      Termination Reason:    Namespace CODESIGNING, Code 2 Invalid Page

VM Region Info: 0x103636644 is in 0x103634000-0x103638000; bytes after
start: 9796 bytes before end: 6587
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
VM_ALLOCATE 103630000-103634000 [ 16K] r--/rwx SM=ZER
---> VM_ALLOCATE 103634000-103638000 [ 16K] r-x/rwx SM=COW
VM_ALLOCATE 103638000-103640000 [ 32K] r--/rwx SM=ZER

  Which sounds a lot like codesigning/jit/entitlements stuff.


Release Notes:

- N/A

Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
2024-10-08 17:47:24 +02:00
Joseph T. Lyons
d295c46433
Remove deprecated copilot event (#18862)
`CopilotEvent` was succeeded by `InlineCompletionEvent` 5 months ago.

Release Notes:

- N/A
2024-10-08 11:10:20 -04:00
Joseph T. Lyons
4c7a6f5e7f
Add is_via_ssh field to editor events (#18837)
Release Notes:

- N/A
2024-10-08 10:30:04 -04:00
Peter Tripp
dd44168cad
dart: Improve indentation (#18845)
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-08 10:20:20 -04:00
Joseph T. Lyons
5bb18adbe8
Inform users they can ask us to reopen issues closed by the stale issue action (#18857)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Release Notes:

- N/A
2024-10-08 08:13:29 -04:00
Thorsten Ball
b2eb439f32
remote server: Add more debug logging (#18855)
Closes #ISSUE

Release Notes:

- N/A
2024-10-08 13:57:26 +02:00
Bennet Bo Fenner
f0566d54eb
ssh: Log error when remote server panics (#18853)
Release Notes:

- N/A
2024-10-08 12:57:47 +02:00
Thorsten Ball
be531653a4
Direnv warn (#18850)
Follow-up fixes to #18567

Release Notes:

- N/A
2024-10-08 11:54:28 +02:00
Bennet Bo Fenner
fa85238c69
ssh: Limit amount of reconnect attempts (#18819)
Co-Authored-by: Thorsten <thorsten@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-08 11:37:54 +02:00
Stanislav Alekseev
910a773b89
Display environment loading failures in the activity indicator (#18567)
As @maan2003 noted in #18473, we should warn the user if direnv call
fails

Release Notes:

- Show a notice in the activity indicator if an error occurs while
loading the shell environment
2024-10-08 11:36:18 +02:00
Peter Tripp
87cc208f9f
docs: Fix ollama available_models example (#18842)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
2024-10-07 21:04:36 -04:00
Max Brunsfeld
b0a16a7601
Fix bugs with applying hunks from branch buffers (#18721)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-10-07 16:28:33 -07:00
Marshall Bowers
3c91184726
collab: Drop mistakenly-added columns from the usages table (#18835)
This PR drops the `cache_creation_input_tokens_this_month ` and
`cache_read_input_tokens_this_month ` columns from the `usages` table in
the LLM database.

We mistakenly added these in #18834, but these aren't necessary due to
the structure of the `usages` table. We weren't actually using these
columns anywhere.

Release Notes:

- N/A
2024-10-07 18:21:48 -04:00
Marshall Bowers
d55f025906
collab: Track cache writes/reads in LLM usage (#18834)
This PR extends the LLM usage tracking to support tracking usage for
cache writes and reads for Anthropic models.

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Antonio <antonio@zed.dev>
2024-10-07 17:32:49 -04:00
Marshall Bowers
c5d252b837
collab: Add missing cmake dependency to Dockerfile (#18832)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
This PR adds the missing `cmake` dependency to the Docker image that is
now needed in order to build collab.

Release Notes:

- N/A
2024-10-07 16:25:17 -04:00
Joseph T. Lyons
a15b10986a
Add ssh initialization events (#18831)
Release Notes:

- N/A
2024-10-07 16:17:43 -04:00
Mikayla Maki
5387a6f7f9
Fix an issue where LLM requests would block forever (#18830)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-07 16:03:26 -04:00
Mikayla Maki
8cdb9d6b85
Fix a bug where HTTP errors where being reported incorrectly (#18828)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-07 12:03:02 -07:00
Marshall Bowers
7d380e9e18
Temporarily prevent deploying collab to production (#18825)
This PR adds a temporary measure to prevent deploying collab to
production, while we investigate some issues stemming from the HTTP
client change.

Release Notes:

- N/A
2024-10-07 14:31:23 -04:00
Piotr Osiewicz
60c12a8d06
ssh: Remove old dev servers code paths (#18823)
Closes #ISSUE

Release Notes:

- N/A
2024-10-07 19:18:44 +02:00
Marshall Bowers
11206a8444
ui: Fix avatar indicators getting cut off (#18821)
This PR fixes an issue introduced in #18810 that was causing the avatar
indicators to get cut off.

Release Notes:

- N/A
2024-10-07 12:53:11 -04:00
Marshall Bowers
c83690ff14
storybook: Wire up HTTP client (#18818)
This PR wires up the HTTP client in the Storybook.

Release Notes:

- N/A
2024-10-07 12:29:10 -04:00
Marshall Bowers
d1a758708d
php: Bump to v0.2.1 (#18815)
This PR bumps the PHP extension to v0.2.1.

Changes:

- https://github.com/zed-industries/zed/pull/18368
- https://github.com/zed-industries/zed/pull/18774

Release Notes:

- N/A
2024-10-07 10:23:16 -04:00
Marshall Bowers
7c7151551a
proto: Bump to v0.2.0 (#18814)
This PR bumps the Protobuf extension to v0.2.0.

Changes:

- https://github.com/zed-industries/zed/pull/18763

Release Notes:

- N/A
2024-10-07 10:11:12 -04:00
Bennet Bo Fenner
a3b63448df
ssh: Do not cancel connection process if user is typing password (#18812)
Previously, the connection process would be cancelled after 10 seconds,
even if the connection was established successfully but the user was
still typing in a password.
We know recognize when the user is prompted for a password, and cancel
the timeout task.

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

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-07 15:53:32 +02:00
Nate Butler
65c9b15796
Remove avatar shape (#18810)
This PR re-removes `AvatarShape` as it is unused. The previous time it
was removed incorrectly, resulting in square avatars!

Release Notes:

- N/A
2024-10-07 09:23:40 -04:00
Bennet Bo Fenner
25a97a6a2b
ssh: Detect timeouts when server is unresponsive (#18808)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
To detect connection timeouts we ping the remote server every X seconds
and attempt to reconnect if the server failed to respond.
Next up is showing some feedback in the UI to make this visible to the
user, and stop reconnecting after X amount of retries.

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-07 15:08:16 +02:00
Piotr Osiewicz
5aa165c530
ssh: Overhaul remoting UI (#18727)
Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2024-10-07 15:01:50 +02:00
Thorsten Ball
9c5bec5efb
formatting: Use project environment to find external formatters (#18611)
Closes #18261

This makes sure that we find external formatters in the project
environment.

TODO:

- [x] Use a different type for the triplet of `(buffer_handle,
buffer_path, buffer_env)`. Something like `FormattableBuffer`.
- [x] Test this!!

Release Notes:

- Fixed external formatters not being found, even when they were
available in the `$PATH` of a project.

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-07 12:24:12 +02:00
Thorsten Ball
c03b8d6c48
ssh remoting: Enable reconnecting after connection losses (#18586)
Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-07 11:40:59 +02:00
Danilo Leal
67fbdbbed6
Put back code that makes the avatar rounded (#18799)
Follow-up to https://github.com/zed-industries/zed/pull/18768

---

Release Notes:

- N/A
2024-10-07 05:42:48 -03:00
Piotr Osiewicz
03c84466c2
chore: Fix some violations of 'needless_pass_by_ref_mut' lint (#18795)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
While this lint is allow-by-default, it seems pretty useful to get rid
of mutable borrows when they're not needed.

Closes #ISSUE

Release Notes:

- N/A
2024-10-07 01:29:58 +02:00
Agustin Gomes
59f0f4ac42
Fix script/linux on RHEL/Fedora (#18788)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
- Add missing `/etc/os-release` from a grep call
- Remove typo `grep grep` from another.

Co-authored-by: Peter Tripp <peter@zed.dev>
2024-10-06 14:47:48 -04:00
Peter Tripp
bd746145b0
ci: Make docs-only PRs only trigger docs-related tests (#18744)
This should speed up any docs-only PRs so that they don't have to run the full 5 minute battery of tests.

Release Notes:

- N/A
2024-10-06 10:28:39 -04:00
Peter Tripp
1b06c70a76
Fix alt-t context (#18783)
- Fix incorrect context introduced in https://github.com/zed-industries/zed/pull/18749/

Release Notes:

- N/A
2024-10-06 10:26:26 -04:00
Peter
06bd2431d2
proto: Add language server support (#18763)
Closes #18762

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-06 10:12:06 -04:00
Roman Zipp
200b2bf70a
php: Add syntax highlighting for Intelephense completions (#18774)
Release Notes:

- N/A

This PR introduces syntax highlighting for intelephense autocomple. The
styling was selected to roughly match PHPStorm's default scheme.

Please note that I'm not very familiar with writing Rust, but I'm happy
to adapt to any requested changes!

## Examples

### Object attributes, methods and constants

![Screenshot 2024-10-06 at 13 38
03](https://github.com/user-attachments/assets/a91634ff-0f2e-41f0-b548-ecb09c40947c)
![Screenshot 2024-10-06 at 13 38
11](https://github.com/user-attachments/assets/b6f179f4-898b-4d82-9d36-a3e82328325c)

### Typed enum members

![Screenshot 2024-10-06 at 13 38
53](https://github.com/user-attachments/assets/7133b981-4f68-4210-b233-403cdf3ec9bb)
![Screenshot 2024-10-06 at 13 38
41](https://github.com/user-attachments/assets/2e806f3d-3538-45f2-b075-b8be5902b786)

### Variables

Includes altered highlighting for [reserved variable
names](https://www.php.net/manual/en/reserved.variables.php).

![Screenshot 2024-10-06 at 13 39
30](https://github.com/user-attachments/assets/be426eb8-5879-432d-b302-391c2c68a7cb)

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-06 10:11:21 -04:00
Nate Butler
8376dd2011
ui crate docs & spring cleaning (#18768)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Similar to https://github.com/zed-industries/zed/pull/18690 &
https://github.com/zed-industries/zed/pull/18695, this PR enables
required docs for `ui` and does some cleanup.

Changes:
- Enables the `deny(missing_docs)` crate-wide.
- Adds `allow(missing_docs)` on many modules until folks pick them up to
document them
- Documents some modules (all in `ui/src/styles`)
- Crate root-level organization: Traits move to `traits`, other misc
organization
- Cleaned out a bunch of unused code.

Note: I'd like to remove `utils/format_distance` but the assistant panel
uses it. To move it over to use the `time_format` crate we may need to
update it to use `time` instead of `chrono`. Needs more investigation.

Release Notes:

- N/A
2024-10-05 23:28:34 -04:00
Chris Boette
c9bee9f81f
docs: Note the need for Rust when developing extensions (#18753)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
2024-10-05 12:26:28 -04:00
Kirill Bulatov
1f31022cbe
Compare migrations formatted uniformly (#18760)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Otherwise old migrations may be formatted differently than new
migrations, causing comparison errors.

Follow-up of https://github.com/zed-industries/zed/pull/18676

Release Notes:

- N/A
2024-10-05 12:58:45 +03:00
Peter Tripp
7608000df8
Fix option-t and option-shift-t in terminal (#18749)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
2024-10-04 16:56:01 -04:00
Remco Smits
8f27ffda4d
gpui: Fix uniform list horizon offset for non-horizontal scrollable lists (#18748)
Closes #18739

/cc @osiewicz 
/cc @maxdeviant 

I'm not sure why the `+ padding.left` was added, but this was the cause
of the issue. I also tested removing the extra left padding but didn't
seem to see a difference inside the project panel. So we can maybe even
remove it?

**Before:**
![Screenshot 2024-10-04 at 21 43
34](https://github.com/user-attachments/assets/b5d67cd9-f92b-4301-880c-d351fe156c98)

**After:**
<img width="294" alt="Screenshot 2024-10-04 at 21 49 05"
src="https://github.com/user-attachments/assets/8cc84170-a86b-46b8-91c9-39def64f0bd0">

Release Notes:

- Fix code action list not horizontal aligned correctly
2024-10-04 23:07:58 +03:00
Marshall Bowers
cee019b1ea
editor: Qualify RangeExt::overlaps call to prevent phantom diagnostics (#18743)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
This PR qualifies a call to `RangeExt::overlaps` to avoid some confusion
in rust-analyzer not being able to distinguish between
`RangeExt::overlaps` and `AnchorRangeExt::overlaps` and producing
phantom diagnostics.

We may also want to consider renaming the method on `AnchorRangeExt` to
disambiguate them.

Release Notes:

- N/A
2024-10-04 15:06:05 -04:00
Boris Cherny
01ad22683d
telemetry: Add language_name and model_provider (#18640)
This PR adds a bit more metadata for assistant logging.

Release Notes:

- Assistant: Added `language_name` and `model_provider` fields to
telemetry events.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Max <max@zed.dev>
2024-10-04 14:37:27 -04:00
Peter Tripp
dfe1e43832 docs: Linux XDG desktop secrets portals 2024-10-04 14:13:07 -04:00
Marshall Bowers
e3a6f89e2d
Make report_assistant_event take an AssistantEvent struct (#18741)
This PR makes the `report_assistant_event` method take an
`AssistantEvent` struct instead of all of the struct fields as
individual parameters.

Release Notes:

- N/A
2024-10-04 13:19:18 -04:00