Commit graph

24576 commits

Author SHA1 Message Date
Cole Miller
74620e611e
Improve performance of go-to-diagnostic when many diagnostics are present (#23166)
Instead of eagerly calling `to_offset` on the anchor ranges for each
diagnostic in the direction of the search, work lazily in terms of
anchors and convert to offsets at the very end.

Release Notes:

- N/A
2025-01-15 15:02:35 +00:00
Conrad Irwin
9d3a0594f9
Exclude function keys from input handler (#23070)
Fixes #22674

Release Notes:

- Fixed a bug binding to `fn-X` (where X is a printing key) on macOS
2025-01-15 14:33:28 +00:00
Thorsten Ball
b1cfc116d0
edit prediction: Fix width of completion item (#23177)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Release Notes:

- N/A

Co-authored-by: Agus <agus@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2025-01-15 14:15:50 +00:00
Agus Zubiaga
4a7630204a
Check for predict-edits feature flag, remove is_staff check (#23165)
Release Notes:

- N/A

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2025-01-15 13:52:10 +00:00
Antonio Scandurra
da8e65b3e5
Show loading state for predictions (#23172)
Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-01-15 13:05:18 +00:00
Thorsten Ball
bf75b33464
vim: Fix inline completions not disappearing in normal mode (#23176)
Closes #23042

Release Notes:

- Fixed inline completions (Copilot, Supermaven, ...) still being
visible sometimes after leaving Vim's insert mode.
2025-01-15 12:44:56 +00:00
Bennet Bo Fenner
bd3f64c5a1
zeta: Allow viewing prompt details in rate completion modal (#23142)
Co-Authored-by: Danilo <danilo@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2025-01-15 11:10:46 +00:00
Thorsten Ball
ae746937af
settings: Rename 'zeta' to 'zed' (#23174)
Old:

```settings.json
{
  "features": {
    "inline_completion_provider": "zeta"
  }
}
```

New & cool:

```settings.json
{
  "features": {
    "inline_completion_provider": "zed"
  }
}
```

Release Notes:

- N/A
2025-01-15 10:53:30 +00:00
Conrad Irwin
37c2ebed7e
Revert "linux: Fix saving file with root ownership (#22045)" (#23162)
Release Notes:

- (temporarily) Removes the linux "save file as root" feature while we
figure out bugs.

Updates https://github.com/zed-industries/zed/pull/22045
2025-01-15 05:17:08 +00:00
Cole Miller
e86fe1d0b9
Fix git commands for staging and unstaging (#23147)
This fixes a bug that prevents unstaging added files.

I've also removed the batching/debouncing logic in the long-running task
that launches the git invocations---I added this originally but I don't
think it's really necessary.

Release Notes:

- N/A
2025-01-15 00:49:07 +00:00
Marshall Bowers
de6216a02b
ui: Move IconDecoration and DecoratedIcon to their own modules (#23157)
This PR moves the `IconDecoration` and `DecoratedIcon` components to
their own modules.

Release Notes:

- N/A
2025-01-15 00:27:26 +00:00
Marshall Bowers
167c564509
theme: Pull directory and chevron icons out of IconTheme::file_icons (#23155)
This PR pulls the directory and chevron icons out of the
`IconTheme::file_icons` collection and promotes them to named fields.

This makes things less stringly-typed when looking up these icons.

Release Notes:

- N/A
2025-01-14 23:53:38 +00:00
Marshall Bowers
1178b3e5f2
gpui: Clean up AppContext doc comments (#23154)
This PR cleans up some doc comments for the `AppContext.

Release Notes:

- N/A
2025-01-14 23:24:34 +00:00
Marshall Bowers
88e42cc7aa
Refactor file icons to use IconTheme (#23153)
This PR adds the initial concept of an `IconTheme` and refactors
`FileIcons` to use it to resolve the icons.

The `IconTheme` will ultimately be used to allow users to select a
different set of icons to use. Currently, however, this is just laying
the foundation for that work.

The association between file types and icons is now handled by the icon
theme when we resolve file icons. This mapping has been moved out of
`file_types.json` and into `icon_theme.rs`.

Release Notes:

- N/A
2025-01-14 22:49:36 +00:00
Danilo Leal
07d582401a
assistant2: Revise thread visual design (#23083)
This PR adjusts the design of the assistant 2 threads with the goal of
reducing visual busyness. My intention is to remove the amount of lines
and borders given it is a relatively tight space. It also refines the
"generating" floating container style, finally leveraging linear
gradients that were recently added to GPUI! Now, we only display headers
for "you" messages. Assistant responses will be rendered right in the
panel; not bounded by a card container.

<img width="800" alt="Screenshot 2025-01-14 at 7 08 39 PM"
src="https://github.com/user-attachments/assets/a8ffa780-0ef2-4d4b-ae19-3f02fd2d63a6"
/>

Release Notes:

- N/A
2025-01-14 22:29:39 +00:00
Joseph T. Lyons
077767a3b0
Migrate more events to telemetry::event (#22178)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Release Notes:

- N/A
2025-01-14 21:00:24 +00:00
Peter Tripp
b7fd5718a3
Revert "Add emacs keybindings for mark emulation" (#23146)
- Reverts zed-industries/zed#22904
- See also: https://github.com/zed-industries/zed/issues/8580

After using it full-time for a day I very much think an implicit "mark
mode" when the emacs base keymap is enabled is the wrong approach.

Release Notes:

- Reverted "Add emacs keybindings for mark emulation" #23146 (main only)
2025-01-14 20:56:04 +00:00
Yagil Burowski
c038696aa8
Add LM Studio support to the Assistant (#23097)
#### Release Notes:

- Added support for [LM Studio](https://lmstudio.ai/) to the Assistant.

#### Quick demo:


https://github.com/user-attachments/assets/af58fc13-1abc-4898-9747-3511016da86a

#### Future enhancements:
- wire up tool calling (new in [LM Studio
0.3.6](https://lmstudio.ai/blog/lmstudio-v0.3.6))

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-14 20:41:58 +00:00
Kirill Bulatov
4445679f3c
Fix a typo in the task example (#23148)
Release Notes:

- N/A
2025-01-14 20:33:28 +00:00
Nate Butler
a3e7444d77
Git panel polish (#23144)
- Clicking checkbox in the header stages or unstages all changes
- Adds tooltips to header checkbox
- Addis the ability for checkboxes to have tooltips
- Ensure an entry in the list is always selected
- Hide revert all button for now

Release Notes:

- N/A
2025-01-14 20:27:05 +00:00
Cole Miller
d13d099675
git: Restore basic jump-to-file functionality (#23140)
This just opens the file for the selected `GitListEntry` right now;
we'll add back integration with the project diff view later.

Release Notes:

- N/A

---------

Co-authored-by: Nate <nate@zed.dev>
2025-01-14 19:29:43 +00:00
Agus Zubiaga
de5f023477
assistant2: Cancel generation button (#23137)
Turns the "esc to cancel" label into a button so it can be dispatched
via click or keyboard. The keybinding isn't hardcoded anymore.

![CleanShot 2025-01-14 at 13 44
22@2x](https://github.com/user-attachments/assets/a947f58b-7de2-400b-b95a-384b78c79697)


Release Notes:

- N/A
2025-01-14 19:22:48 +00:00
Marshall Bowers
4febc7ea49
assistant2: Cancel pending completion when an error occurs (#23143)
This PR makes it so the pending completion is cleared when an error
occurs.

This makes it so `Thread::is_streaming()` will return `false` in the
error case (and thus hide the streaming indicator in the UI).

Release Notes:

- N/A
2025-01-14 19:04:47 +00:00
Thorsten Ball
c33eb012cf
Change tooltip to 'Edit Prediction' (#23139)
Release Notes:

- N/A
2025-01-14 17:25:10 +00:00
Bennet Bo Fenner
1ddf754b8b
zeta: Rework displaying paths in completion rating modal (#23129)
Two issues i ran into while looking at the completion rating modal
- Single-file worktrees file names are not displayed at all
- Hard to see the filename when the path is long (lots of directories)

This PR fixes this by displaying the filename on the left, followed by
the full path (including the worktree name), similar to how we do it in
the file finder/assistant panel /file command
| Before | After |
|--------|--------|
| <img width="1067" alt="Screenshot 2025-01-14 at 16 09 05"
src="https://github.com/user-attachments/assets/628fde18-da9a-4d98-8ddf-ed0ab0cd8d35"
/> | <img width="1161" alt="Screenshot 2025-01-14 at 16 17 52"
src="https://github.com/user-attachments/assets/80c6a4e1-065d-4b0a-b9c0-5f3391af4557"
/> |





Release Notes:

- N/A
2025-01-14 17:15:24 +00:00
Thorsten Ball
91b36c31e8
environments: Don't load shell environments in non-local worktrees (#23138)
This fixes an error message that has shown up for me when joining collab
projects: "Unable to load shell environment in /<path on another
machine/"

Release Notes:

- Fixed error message about shell environment failing to load when
joining projects in collaboration.
2025-01-14 17:13:55 +00:00
Agus Zubiaga
39ac6e4a75
assistant2: Navigate context strip with keyboard (#23128)
Context pills are now focusable and intractable via the keyboard.

- <kbd>←</kbd> and <kbd>→</kbd> move the focus to the previous or next
item (wrapping if necessary)
- <kbd>↓</kbd> and <kbd>↑</kbd> move the focus vertically
- If the cursor is in the first/last row of the assistant/inline editor,
they will move the focus to the strip
- Inside the strip, they will move the focus to the pill horizontally
overlapping the most
- If already in the first/last row of the strip, they will move to the
first/last pill (like in editors)
- If the first/last pill is focused, they will move the focus back to
the editor
- <kbd>⌫</kbd>  removes the focused pill (unless it's the suggested one)
- <kbd>⏎</kbd> accepts the suggested pill if focused
  


https://github.com/user-attachments/assets/040bc71c-a3ae-4961-9886-2d5c3d290a73



Release Notes:

- N/A
2025-01-14 16:45:11 +00:00
Nate Butler
78fd5b5f02
git_ui: Add Git Panel settings (#23132)
This PR adds settings for the Git Panel.

The new settings include:

| Setting | Description | Default |
|---------|-------------|---------|
| `git_panel.button` | Toggle visibility of the Git Panel button in the
status bar | `true` |
| `git_panel.dock` | Choose where to dock the Git Panel | `"left"` |
| `git_panel.default_width` | Set the default width of the Git Panel in
pixels | `360` |
| `git_panel.status_style` | Select how Git status is displayed |
`"icon"` |
| `git_panel.scrollbar.show` | Configure scrollbar behavior | Inherits
from editor settings |

Example usage:

```json
"git_panel": {
  "button": true,
  "dock": "left",
  "default_width": 360,
  "status_style": "icon",
  "scrollbar": {
    "show": "auto"
  }
}
```

Release Notes:

- N/A
2025-01-14 15:40:45 +00:00
Thorsten Ball
a67709629b
zeta: Various product fixes before Preview release (#23125)
Various fixes for Zeta and one fix that's visible to non-Zeta-using
users of inline completions.

Release Notes:

- Changed inline completions (Copilot, Supermaven, ...) to not show up
in empty buffers.

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Bennet <bennet@zed.dev>
2025-01-14 14:30:27 +00:00
Piotr Osiewicz
1b3b825c7f
lsp: Parse LSP messages on background thread - again (#23122)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This is a follow-up to #12640.
While profiling latency of working with a project with 8192 diagnostics
I've noticed that while we're parsing the LSP messages into a generic
message struct on a background thread, we can still block the main
thread as the conversion between that generic message struct and the
actual LSP message (for use by callback) is still happening on the main
thread.
This PR significantly constrains what a message callback can use, so
that it can be executed on any thread; we also send off message
conversion to the background thread. In practice new callback
constraints were already satisfied by all call sites, so no code outside
of the lsp crate had to be adjusted.

This has improved throughput of my 8192-benchmark from 40s to send out
all diagnostics after saving to ~20s. Now main thread is spending most
of the time updating our diagnostics sets, which can probably be
improved too.

Closes #ISSUE

Release Notes:

- Improved app responsiveness with huge # of diagnostics.
2025-01-14 13:50:54 +00:00
Kirill Bulatov
8e65ec1022
Disable Prettier for C projects by default (#23119)
Follow-up of https://github.com/zed-industries/zed/pull/23112

Same reasoning applies.

Release Notes:

- Changed default formatter for C to be the primary language server, not
Prettier. Format-on-save is still disabled by default for C, but if one
uses the editor: format command now, it will default to the language
server. clangd can format C files, whereas prettier cannot.
2025-01-14 11:47:22 +00:00
Thorsten Ball
fcadd3e1ff
cpp: Enable language server as formatter by default (#23112)
As @hferreiro points out in [this

comment](https://github.com/zed-industries/zed/pull/18752#issuecomment-2589340565):
C++ and prettier don't work well together, so let's make the default
formatter for C++ the primary language server. We get that by disabling
prettier.

Release Notes:

- Changed default formatter for C++ to be the primary language server,
not Prettier. Format-on-save is still disabled by default for C++, but
if one uses the `editor: format` command now, it will default to the
language server. `clangd` can format C++ files, whereas prettier cannot.
2025-01-14 09:56:57 +00:00
Michael Sloan
a13e64e0cd
Keymap json schema generation improvements intended to be in #23098 (#23114)
Intended to include these in #23098, but seems they didn't push before
merge. Probably didn't use `--force-with-lease`
2025-01-14 09:51:20 +00:00
0x2CA
26be440d99
vim: Add Subword Textobject (#22387)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Closes #22761

[Vim: subword text object?
#22280](https://github.com/zed-industries/zed/discussions/22280)

Release Notes:

- Added Vim SubWord TextObject

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-01-14 03:34:49 +00:00
0x2CA
03c99e39f9
vim: Fix vim delete to line (#23053)
Closes #23024

Release Notes:

- Fixed Vim `dxG` delete to line

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-01-14 03:07:47 +00:00
Marshall Bowers
93f117b21a
Improve registration for Assistant code action providers (#23099)
This PR is a follow-up to
https://github.com/zed-industries/zed/pull/22911 to further improve the
registration of code action providers for the Assistant in order to
prevent duplicates.

The `CodeActionProvider` trait now has an `id` method that is used to
return a unique ID for a code action provider. We use this to prevent
registering duplicates of the same provider.

The registration of the code action providers for Assistant1 and
Assistant2 have also been reworked. Previously we were not call the
registration function—and thus setting up the subscriptions—until we
resolved the feature flags. However, this could lead to the registration
happening too late for existing workspace items.

We now perform the registration right away and then remove the undesired
code action providers once the feature flags have been resolved.

Release Notes:

- N/A
2025-01-13 22:25:58 +00:00
Marshall Bowers
830f45e56a
assistant2: Add floating indicator when a response is streaming (#23096)
This PR adds a separate indicator at the bottom of the thread that shows
when a response is being streamed (as well as how to cancel it):

<img width="1309" alt="Screenshot 2025-01-13 at 4 19 07 PM"
src="https://github.com/user-attachments/assets/b64f785b-d522-458d-b915-3f604890597f"
/>

Release Notes:

- N/A
2025-01-13 22:03:45 +00:00
Michael Sloan
ae103fdf64
Fix confusing keymap json errors and hovers for nonexistent actions (#23098)
Release Notes:

- N/A
2025-01-13 21:53:12 +00:00
Marshall Bowers
c599ba64bc
assistant2: Only show the streaming indicator on the last Assistant message (#23090)
Some checks are pending
CI / check_docs_only (push) Waiting to run
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR is a follow-up to #23078 to ensure that the streaming indicator
only shows up on the last Assistant message.

Release Notes:

- N/A
2025-01-13 21:09:01 +00:00
Piotr Osiewicz
867c069b99
editor: Adjust offset of the opened jump target in the multibuffer (#23091)
This PR fixes an issue with jumping from multi_buffer to a file; namely,
the scroll offset of the opened buffer used to match the position within
the multibuffer, but it broke a while back. This is because we were
opening a buffer without providing the data about the origin scroll
offset.

Closes #ISSUE

Release Notes:

- Fixed a bug where the relative position of an excerpt within the
multibuffer was not accounted for while jumping to the buffer, causing
the clicked line to drastically change position on screen.
2025-01-13 21:08:46 +00:00
Marshall Bowers
ac2d3eec91
Remove commented-out code (#23089)
This PR removes some commented-out code from the codebase.

Release Notes:

- N/A
2025-01-13 21:02:45 +00:00
Agus Zubiaga
4054d4a5b7
assistant2: Fix inline context picker and handle dismiss (#23081)
The new `ContextMenu`-based `ContextPicker` requires initialization when
opened, but we were only doing this for the `ContextStrip` picker, not
the inline one.

Additionally, because we have a wrapper element around ContextMenu, we
need to propagate the `DismissEvent` so that it properly closes when
Escape is pressed.

Release Notes:

- N/A
2025-01-13 21:00:20 +00:00
Michael Sloan
7c2c409f6d
Show configuration in language server debug logs (#23084)
Release Notes:

- Added configuration sent on initialization to the `Server Info`
section of the language server logs.
2025-01-13 21:00:03 +00:00
Michael Sloan
d4e91c1898
Add support for namespace changes in action deprecations (#23086)
cc @cole-miller 

Release Notes:

- N/A
2025-01-13 20:56:22 +00:00
Michael Sloan
b633f62aa6
Add test that JSON schema generation works + actions build from no input (#23049)
Release Notes:

- N/A
2025-01-13 20:42:08 +00:00
Joseph T. Lyons
85b727c1a2
Remove inaccurate comments (#23056)
These comments are inaccurate. Even if `convert_case` provided a way to
customize which boundaries were used (which is now does, it 0.7.1), they
would be removed from the string and replaced with the new boundary
character (`-`, `_`, ...), and we'd lose the ability to reconstruct the
text the way the author formatted it. This is not a hack, this is the
way we have to do it.

Release Notes:

- N/A
2025-01-13 20:38:44 +00:00
Cole Miller
bd3c7d6cbf
git: Fully implement "all staged" checkbox (#23079)
Also includes some improvements to the "stage/unstage all" actions and
buttons.

Release Notes:

- N/A
2025-01-13 20:13:14 +00:00
Marshall Bowers
2179be1855
assistant2: Add an indicator when a response is streaming in (#23078)
This PR adds an indicator to the Assistant message to indicate that it
is still streaming:

<img width="1310" alt="Screenshot 2025-01-13 at 2 10 33 PM"
src="https://github.com/user-attachments/assets/635ee60d-b5ea-40ac-952a-b7bfa7e04fcc"
/>

Release Notes:

- N/A
2025-01-13 19:29:50 +00:00
Michael Sloan
2f762955cd
Take a reference in LSP notify (#23077)
In current code this doesn't have benefit. In preparation for avoiding a
clone of workspace configuration. Having the interface this way may make
opportunities for efficiency clearer in the future

Release Notes:

- N/A
2025-01-13 19:26:28 +00:00
Marshall Bowers
c1c767a5bd
assistant2: Make Esc cancel current completion (#23076)
This PR makes it so pressing `Esc` in Assistant2 will cancel the current
completion.

Release Notes:

- N/A
2025-01-13 19:09:27 +00:00