Commit graph

23973 commits

Author SHA1 Message Date
Marshall Bowers
63d8a43f9d
assistant2: Fix file context picker (#22163)
This PR fixes an issue with the Assistant2 file context picker where
files weren't being attached properly.

We needed to retrieve the files from the worktree without the worktree
root name in the file path.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-12-17 16:53:56 -05:00
Nathan Sobo
81c118d67d
Store focus handles in AppContext instead of Window (#22158)
Some checks are pending
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) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (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
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
Previously, each window stored its own collection of focus handles. This
meant that to create a focus handle, you needed to have access to a
Window. I'm working on a simplification to gpui's context types that
removes `WindowContext` and `ViewContext` in favor of passing a window
reference explicitly when rendering or handling events. You'll still
need a window to manipulate focus, but it will be helpful to be able to
create focus handles without a window.

cc @mgsloan 

Release Notes:

- N/A
2024-12-17 14:41:00 -07:00
Marshall Bowers
e1ca5ed836
zed: Fix formatting in workspace initialization (#22152)
This PR fixes some formatting issues in the workspace initialization
code that stemmed from certain constructs causing `rustfmt` to bail out
of the formatting.

The bulk of the content of `initialize_workspace` has been factored out
into functions, as having nested closures within closures seems to be
the primary cause of `rustfmt` being unhappy.

Release Notes:

- N/A
2024-12-17 16:34:52 -05:00
Peter Tripp
fa1b1c6aff
docs: Fix indentation of JSON example lsp settings (#22162) 2024-12-17 16:09:13 -05:00
Peter Tripp
0511f9268b
Add tooltip for Markdown Preview copy code button (#22057) 2024-12-17 14:46:38 -05:00
Marshall Bowers
70f82f84c6
telemetry: Fix license symlink (#22153)
This PR fixes the `LICENSE-GPL` symlink in the `telemetry` crate.

Release Notes:

- N/A
2024-12-17 14:29:04 -05:00
Marshall Bowers
1c4868979d
Allow the use of both Assistants when in the assistant2 feature flag (#22150)
This PR makes it so both Assistant panels are visible when in the
`assistant2` feature flag.

This way folks can continue using Assistant1 if Assistant2 isn't meeting
their needs.

Right now they are shown as two different panels shown in the status bar
(although using the same icon), but this is just a temporary state until
we can surface the Assistant1 functionality in Assistant2 somehow.

Note that the inline assist will always use the Assistant2 panel.

Release Notes:

- N/A
2024-12-17 14:23:57 -05:00
Danilo Leal
c86cf2c3e1
zeta: Refine visuals for the completion popover (#22142)
Most notably, trying out a different icon and adding the "Completion"
word to the side of the provider name.

<img width="800" alt="Screenshot 2024-12-17 at 13 04 55"
src="https://github.com/user-attachments/assets/6dcaa699-f358-4242-9812-e1668f426207"
/>

Release Notes:

- N/A
2024-12-17 15:45:58 -03:00
Conrad Irwin
7425d242bc
Add telemetry::event! (#22146)
CC @JosephTLyons

Release Notes:

- N/A
2024-12-17 11:39:18 -07:00
Marshall Bowers
b17f2089a2
assistant2: Sketch in directory context picker (#22148)
This PR sketches in the structure for the directory context picker.

Waiting on implementing the actual behavior until we fix the issues with
the file context picker.

Release Notes:

- N/A
2024-12-17 13:02:46 -05:00
Marshall Bowers
68e3d79847
assistant2: Use ContextKind to match on ContextPicker entries (#22143)
This PR updates the `ContextPicker` entries to match on the
`ContextKind` instead of using strings.

Release Notes:

- N/A
2024-12-17 11:43:27 -05:00
Carlos Kieliszewski
ed3e647ed7
editor: Add horizontal scrollbar (#19495)
![editor_scrollbars](https://github.com/user-attachments/assets/76c26776-8fe4-47f8-9c79-9add7d7d2151)

Closes #4427 

Release Notes:

- Added a horizontal scrollbar to the editor panel
- Added `axis` option to `scrollbar` in the Zed configuration, which can
forcefully disable either the horizontal or vertical scrollbar
- Added `horizontal_scroll_margin` equivalent to
`vertical_scroll_margin` in the Zed configuration

Rough Edges:

This feature seems mostly stable from my testing. I've been using a
development build for about a week with no issues. Any feedback would be
appreciated. There are a few things to note as well:

1. Scrolling to the lower right occasionally causes scrollbar clipping
on my end, but it isn't consistent and it isn't major. Some more testing
would definitely be a good idea. [FIXED]
2. Documentation may need to be modified
3. I added an `AxisPair` type to the `editor` crate to manage values
that have a horizontal and vertical variant. I'm not sure if that's the
optimal way to do it, but I didn't see a good alternative. The `Point`
type would technically work, but it may cause confusion.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-12-17 17:24:59 +01:00
Marshall Bowers
6fa5a17586
assistant2: Only add context if it is non-empty (#22141)
This PR fixes an issue where we were attaching empty message content
even if there was no context.

Release Notes:

- N/A
2024-12-17 11:09:10 -05:00
Marshall Bowers
a6b717b97b
assistant2: Add spacing between historical thread entries (#22140)
This PR adds spacing between entries in the historical threads view:

<img width="1371" alt="Screenshot 2024-12-17 at 10 51 26 AM"
src="https://github.com/user-attachments/assets/f66d69e9-eb59-4c76-b3b5-c4d60190c3cc"
/>

Release Notes:

- N/A
2024-12-17 11:03:09 -05:00
Thorsten Ball
228c89a78a
Show inline documentation in menu even if documentation is disabled (#22137)
This makes inline completions show up in the completion menu even if the
user has set `"show_completion_documentation": false` in their settings,
because there is no other way to show the Zeta completion.

Follow-up to #22093

Release Notes:

- N/A

Co-authored-by: Danilo <danilo@zed.dev>
2024-12-17 14:52:08 +01:00
Danilo Leal
3978937457
Add stray visual refinements (#22125)
Some checks are pending
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) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (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
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
In different parts of the app, but all of them can be seen in the
screenshot below:

<img width="800" alt="Screenshot 2024-12-16 at 21 31 51"
src="https://github.com/user-attachments/assets/79c0ad5e-4e4c-469d-93a1-fd4e707d4aaa"
/>

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2024-12-17 09:40:16 -03:00
Thorsten Ball
95334cb0ad
Show inline completions inside the completion menu if both are available (#22093)
Screenshot:

![screenshot-2024-12-17-11 53
41@2x](https://github.com/user-attachments/assets/bace3d20-7175-4833-9326-7b859166c0e8)

Demo:


https://github.com/user-attachments/assets/70197042-4785-4e45-80fd-29d12e68333f



(Note for Joseph/Peter: this supersedes
https://github.com/zed-industries/zed/pull/22069)

Release Notes:
- Changed inline completions to show up inside the normal completions in
case LSP and inline-completions are available. In that case, the inline
completion will be the first entry in the menu and can be selected with
`<tab>`.

---------

Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Danilo <danilo@zed.dev>
2024-12-17 13:34:25 +01:00
Kirill Bulatov
cc56ed7a88
Focus terminal when creating one after activating the terminal panel (#22133)
Follow-up of https://github.com/zed-industries/zed/pull/22082

Release Notes:

- N/A
2024-12-17 14:19:13 +02:00
lihsai0
4878b9bbed
docs: Fix shortcut for select a smaller syntax node (#22135)
Release Notes:

- N/A
2024-12-17 14:13:10 +02:00
Ignat S.
e1bc48c554
Workspace move editor actions (#21760)
Closes #20205

Release Notes:

- Added `MoveItemToPane` and `MoveItemToPaneInDirection` actions

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2024-12-17 13:39:36 +02:00
Thorsten Ball
9082a006d6
Revert "vim: Don't dismiss inline completion when switching to normal mode (#22075)" (#22131)
This reverts commit 38c0aa303e from
#22075.

Release Notes:

- N/A
2024-12-17 09:24:33 +01:00
mgsloan@gmail.com
ebf6804afd Misc improvements to Bounds in gpui geometry
* Makes `dilate` and `inset` return.

* Implements `Add<Point<T>>` and `Sub<Point<T>>`.

* Makes some trait constraints more precise.
2024-12-17 00:10:10 -07:00
Michael Sloan
a062c0f1bc
Improve code context menu layout position esp visual stability (#22102)
* Now decides whether the menu is above or below the target position
before rendering it. This causes its position to no longer vary
depending on the length of completions

* When the text area is height constrained (< 12) lines, now chooses the
side which has the most space. Before it would always display above if
height constrained below.

* Misc code cleanups

Release Notes:

- Improved completions menu layout to be more stable and use available
space better.
2024-12-16 23:17:36 -07:00
Michael Sloan
fc5a810408
Add Corner to geometry and make names of corner methods consistent (#22119)
Release Notes:

- N/A
2024-12-16 22:57:15 -07:00
Marshall Bowers
3052fc2565
Use the same InlineAssist action between both assistant and assistant2 (#22126)
Some checks are pending
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) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (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
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 makes it so `assistant` and `assistant2` both use the same
action for inline assist (`zed_actions::InlineAssist`).

This makes it so the keybindings to deploy the inline assist seamlessly
swap based on the feature flag without needing to rebind them.

One minor caveat: if you're using `assistant2` the action name in the
command palette will be `assistant: inline assist`.

Release Notes:

- N/A
2024-12-16 23:57:07 -05:00
Marshall Bowers
80431e5518
assistant2: Add keybinding to toggle ContextPicker (#22124)
This PR adds an action and associated keybinding
(<kbd>Cmd+Shift+A</kbd>) to toggle the context picker.

This allows for adding context via the keyboard.

Release Notes:

- N/A
2024-12-16 20:20:32 -05:00
Danilo Leal
28087934d1
assistant2: Add text_ellipsis to the PastThread label (#22117)
To treat the case for whenever the assistant panel gets small.

<img width="360" alt="Screenshot 2024-12-16 at 20 12 34"
src="https://github.com/user-attachments/assets/5426a5b9-9baf-41e3-a2c6-2f997378c994"
/>

Release Notes:

- N/A
2024-12-16 21:43:12 -03:00
Michael Sloan
5558b04223
Misc geometry cleanup (#22123)
Release Notes:

- N/A
2024-12-16 17:30:07 -07:00
Marshall Bowers
0ca0433912
assistant2: Add keybinding to toggle LanguageModelSelector (#22122)
This PR adds a keybinding to toggle the `LanguageModelSelector` in
Assistant2.

Release Notes:

- N/A
2024-12-16 19:19:24 -05:00
Marshall Bowers
d11deff3c2
ui: Round hover styles for ListItems with outlined set (#22120)
This PR makes `ListItem`s with `outlined` set use the same rounding for
their hover state to ensure that the hover background doesn't bleed
outside of the outline.

Release Notes:

- N/A
2024-12-16 18:43:16 -05:00
Marshall Bowers
8e71e46867
ui: Add text_ellipsis method to Labels (#22118)
This PR adds a `text_ellipsis` method to `Label`s.

This can be used to truncate the text with an ellipsis without needing
to wrap the `Label` in another element.

Release Notes:

- N/A
2024-12-16 18:43:01 -05:00
Michael Sloan
ac24f074df
Use Popover and ListItem in code actions menu (#22112)
This is good for code sharing but also sets up #22102 for making
assumptions about popover y padding.

Release Notes:

- N/A
2024-12-16 16:24:38 -07:00
Marshall Bowers
ccf2a60039
assistant2: Persist model selector changes (#22116)
This PR makes the language model selector in the Assistant2 panel
persist the model changes to the settings.

Release Notes:

- N/A
2024-12-16 18:00:40 -05:00
Kirill Bulatov
db2aa0bca5 Use a proper color for the folded buffer border selection 2024-12-17 01:00:31 +02:00
Marshall Bowers
373854be46
assistant2: Uniquely identify remove buttons on ContextPills (#22115)
This PR ensures that the remove buttons on the `ContextPill`s are
uniquely identified.

Release Notes:

- N/A
2024-12-16 17:57:05 -05:00
Lukas Geiger
eb74332e96
extensions_ui: Add Cython as a suggested extension (#22053)
This suggest the [Cython
extension](https://github.com/lgeiger/zed-cython) for syntax
highlighting of Cython files.

Release Notes:

- Suggest Cython extension for syntax highlighting of `.pyx`, `.pxd` and
`.pxi` files
2024-12-16 17:54:55 -05:00
Marshall Bowers
1932c04b84
assistant2: Add ability to resize the panel (#22113)
This PR adds the ability to resize the Assistant2 panel.

Release Notes:

- N/A
2024-12-16 17:35:56 -05:00
Kirill Bulatov
97d9567188
Show a brighter border around folded blocks with selections (#22114)
Follow-up of https://github.com/zed-industries/zed/pull/22046

Properly [un]fold blocks based on the selections

<img width="1728" alt="image"
src="https://github.com/user-attachments/assets/73f319ee-3005-4a3b-95ee-4c6deb5cd0b8"
/>


Release Notes:

- N/A
2024-12-17 00:33:43 +02:00
Danilo Leal
53c8b48647
assistant2: Add stray visual adjustments (#22111)
Mostly minor tweaks to make it closer to the prototype. More to come.

| With message | Empty state |
|--------|--------|
| <img width="1420" alt="Screenshot 2024-12-16 at 18 59 40"
src="https://github.com/user-attachments/assets/5df791bf-577a-4f01-9045-80568604099f"
/> | <img width="1420" alt="Screenshot 2024-12-16 at 18 59 33"
src="https://github.com/user-attachments/assets/adbf1673-3040-4b2b-8d65-f8b38a83c1d0"
/> |

Release Notes:

- N/A
2024-12-16 19:23:42 -03:00
Marshall Bowers
92fb38acb6
assistant2: Wire up context for terminal inline assist (#22108)
This PR updates up the context picker for the terminal's inline assist.

Release Notes:

- N/A

Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Agus <agus@zed.dev>
2024-12-16 16:22:16 -05:00
uncenter
84392fbc2f
docs: Use preferred languages instead of deprecated language field (#22107)
Some checks are pending
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) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (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
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
Ref
https://github.com/zed-industries/zed/issues/21994#issuecomment-2545988779,
`language` is already deprecated but was still suggested in the docs
here.

Release Notes:

- N/A
2024-12-16 16:11:32 -05:00
Kirill Bulatov
91fdb5d2a9
Return back the logic for indent guides check (#22095)
Follow-up of https://github.com/zed-industries/zed/pull/22046

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
2024-12-16 22:53:14 +02:00
Max Brunsfeld
8127decd2d
Extract logic around custom text highlights out of InlayChunks iterator (#22104)
This is a pure refactor, extracted from
https://github.com/zed-industries/zed/tree/new-diff-map

Release Notes:

- N/A

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Agus <agus@zed.dev>
2024-12-16 12:51:17 -08:00
Marshall Bowers
4bf005ef52
assistant2: Wire up context picker with inline assist (#22106)
This PR wire up the context picker with the inline assist.

UI is not finalized.

Release Notes:

- N/A

---------

Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Agus <agus@zed.dev>
2024-12-16 15:46:28 -05:00
uncenter
082469e173
docs: Use rev instead of commit for extension grammars (#22105)
`rev` is the preferred key
2024-12-16 15:40:02 -05:00
Danilo Leal
ec741d61ed
assistant2: Adjust thread history list item visuals (#21998)
Most notably, adding the `outlined` property in the `ListItem`
component.

<img width="800" alt="Screenshot 2024-12-13 at 20 35 39"
src="https://github.com/user-attachments/assets/adac4463-66f9-4b5e-b1c0-93c34f068dc4"
/>

Release Notes:

- N/A
2024-12-16 16:42:09 -03:00
Nate Butler
426f94b310
git_ui: Update todos (#22100)
`todo!()` -> `TODO`

Release Notes:

- N/A
2024-12-16 13:39:40 -05:00
Marshall Bowers
eff61ee764
assistant2: Remove WeakView<Workspace> optionality for inline assist (#22099)
This PR removes the optionality for the `WeakView<Workspace>` that we
pass to the inline assist.

This was always `Some` in practice, so it seems we don't need to have it
be an `Option`.

Release Notes:

- N/A
2024-12-16 13:26:11 -05:00
Marshall Bowers
caefdcd7f1
assistant2: Factor out ContextStrip (#22096)
This PR factors a `ContextStrip` view out of the `MessageEditor` so that
we can use it in other places.

Release Notes:

- N/A
2024-12-16 12:45:01 -05:00
Kirill Bulatov
ff2ad63037
Allow splitting terminal items in the central pane group (#22088)
Follow-up of https://github.com/zed-industries/zed/pull/22004
Closes https://github.com/zed-industries/zed/issues/22078

Release Notes:

- Fixed splitting terminal items in the center
2024-12-16 19:23:01 +02:00