Commit graph

24929 commits

Author SHA1 Message Date
Michael Sloan
93c7b54caa
Renames: HighlightedText->HighlightedMatch + HighlightedEdits->HighlightedText (#24057)
In support of work on
https://github.com/zed-industries/zed/tree/new-ui-for-edit-prediction-with-lsp-completions,
where we want to be able to extract a range of the buffer as
`HighlightedText`.

Release Notes:

- N/A
2025-01-31 23:15:46 +00:00
Marshall Bowers
4d9659adc4
feature_flags: Add FeatureFlagAppExt::wait_for_flag_or_timeout (#24055)
This PR adds a new `wait_for_flag_or_timeout` method to the
`FeatureFlagAppExt` trait.

This encapsulates the somewhat gnarly code for using `wait_for_flag`
with a timeout.

A side benefit of this is that the tasks waiting on the feature flags
run in parallel, so in the case where the feature flags do not resolve
we don't end up having to wait on consecutive timeouts. This should help
a bit with https://github.com/zed-industries/zed/issues/23922.

Release Notes:

- N/A
2025-01-31 22:35:23 +00:00
Peter Tripp
3af37ddf6d
lmstudio: Support missing quantization in model metadata (#24054)
- Closes https://github.com/zed-industries/zed/issues/23764

Certain models do not include `quantization` parameter from lm studio rest API.
2025-01-31 22:28:11 +00:00
Peter Tripp
df16ef209c
chore: Fix default.json formatting (#24053)
Forgot to run default.json through prettier in #24051. Oops.
2025-01-31 22:20:51 +00:00
Marshall Bowers
1e96663e20
assistant_context_editor: Don't block ContextStore initialization on reloading contexts (#24052)
This PR changes the `ContextStore` constructor to not block on reloading
the contexts before we finish initializing it.

I noticed that the Assistant panel was taking a long time to show up in
the status bar, and upon further investigation uncovered that with a
large number of contexts (I have ~320) it takes a long time to load them
all.

Release Notes:

- N/A
2025-01-31 17:08:33 -05:00
Peter Tripp
de3702bedc
Improve inline_completions.disabled_globs in default.json (#24051)
Make sure that inline completions (Copilot, etc) are disabled for more secret globs (matches `private_files`)
2025-01-31 16:57:54 -05:00
Peter Tripp
d04800c329
Add OpenAI o3-mini support (#24044)
Release Notes:

- Add support for OpenAI o3-mini
2025-01-31 15:48:55 -05:00
Kirill Bulatov
e42b6e6905
Do less git metadata rescans on FS events (#24034)
A preparation for collaborative commit message editing.

Before, almost any `.git`-contained file FS update, except
`.git/fsmonitor--daemon/cookies/**` caused git metadata rescan.
This included `index.lock` that was created after any git operation,
e.g. `git status`, which was unnecessary.
Collaborative editing aims to share `.git/COMMIT_EDITMSG` between
multiple users, so there are potentially multiple users editing the file
and causing excessive events.

The change makes worktree to ignore .git/COMMIT_EDITMSG`,
`.git/index.lock` and `.git/fsmonitor--daemon/**` paths and adjusts the
logic to be more extensible: there's much more files Zed can ignore and
still have its git metadata up to date.

Release Notes:

- N/A
2025-01-31 20:17:57 +00:00
someone13574
0c94bdc8e4
gpui: Update docs to reflect removal of View, ViewContext, WindowContext (#24008)
This PR updates function signatures, docstrings, and gpui's other
documentation to reflect it's new state following the merge of `Model`
and `View` into `Entity` as well as the removal of `WindowContext`.

Release Notes:

- N/A
2025-01-31 11:40:42 -08:00
Ben Kunkle
027fe1b4b5
Ensure pane where search buttons are clicked is focused before dispatching action (#24037)
Closes #23906

Note: Changes the focused pane when search UI is interacted with on an
unfocused pane rather than leaving the focused pane unchanged as
focusing on click is more likely to be the expected behavior

Release Notes:

- Fixes an issue with search actions so that they now execute on the
clicked pane rather than the focused pane when using search UI in
multiple panes
2025-01-31 13:03:11 -06:00
Marshall Bowers
990bdde5e8
gpui: Add helper methods for em width and em advance (#24036)
This PR adds two helpers methods to the `TextSystem`:

- `em_width`
- `em_advance`

These methods return the width and advance width for an `em`,
respectively.

We were using these definitions in a number of different spots, and by
unifying them we better canonicalize that an `em` is based on the `m`
character.

Release Notes:

- N/A
2025-01-31 17:47:44 +00:00
Marshall Bowers
af6548c745
docs: Remove lingering docs for default_dock_anchor (#24029)
This PR removes some lingering docs leftover after `default_dock_anchor`
was removed.

These were missed in https://github.com/zed-industries/zed/pull/18210.

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

Release Notes:

- N/A
2025-01-31 14:34:13 +00:00
João Marcos
6f467281e0
Fix data collection permission asked multiple times for same worktree (#24016)
After the user confirmation, only the current instance of the
completions provider had the answer stored.

In this PR, the changes are propagated by having each provider have an
`Entity<choice>`, and having a lookup map with one `Entity<choice>` for
each worktree that `Zeta` has seen.

Release Notes:

- N/A
2025-01-31 10:22:31 +00:00
Piotr Osiewicz
be4c3cfbd2
workspace: Make "New Window" bring app to foreground (#24015)
Closes #ISSUE

Release Notes:

- "New Window" action will now bring App to foreground.
2025-01-31 11:18:56 +01:00
Conrad Irwin
0ad2aeb2e9
Enable word wrap in feedback modal (#23893)
https://zed-industries.slack.com/archives/C04S7CZPF4M/p1738151539115169

Release Notes:

- Enable word wrap in the feedback modal
2025-01-31 00:13:53 -07:00
Conrad Irwin
f2b3f3a9ab
Allow buffer search in project search (#23819)
Closes #13437
Closes #19993

Release Notes:

- Allow searching within the results of a project search
- vim: Fix `/`/`?`, `n`/`N`, `gn`/`gN`,`*`/`#` in project search results

---------

Co-authored-by: Nico <nico.lehmann@gmail.com>
2025-01-31 00:13:46 -07:00
Jason Lee
e1af35aa15
gpui: Add closest_index_for_position method (#23668)
Closes #ISSUE

Release Notes:

- N/A

------------

I just make a little change to improve `index_for_position` to support
return closest index for position.

I need this method to measure for position cursor in multi-line mode
TextInput.

https://github.com/longbridge/gpui-component/pull/583


https://github.com/user-attachments/assets/c69d098e-d2cb-4053-b739-6c7dd666e769

Before this change, GPUI have `LineLayout::closest_index_for_x` method
for unwrapped line case.


d1be419fff/crates/gpui/src/text_system/line_layout.rs (L58-L94)

This change is equivalent to making `index_for_position` have a
corresponding method to get the closest index like `index_for_x`.
2025-01-31 00:03:56 -07:00
Conrad Irwin
cb15753694
Fix clipping at end of line in vim mode with inlay hints (#23975)
Closes #23877

Co-Authored-By: Ben <ben@zed.dev>
Co-Authored-By: Michael <michael@zed.dev>

Release Notes:

- vim: Fix navigating to end of line with inlay hints

---------

Co-authored-by: Ben <ben@zed.dev>
Co-authored-by: Michael <michael@zed.dev>
2025-01-31 00:00:47 -07:00
Conrad Irwin
5914ccdc51
Deflake fs::test_event_stream_simple (#24013)
Should reduce test flakiness

Release Notes:

- N/A
2025-01-30 23:53:36 -07:00
Marshall Bowers
8be73bf187
collab: Remove unused POST /predict_edits endpoint from LLM service (#23997)
This PR removes the `POST /predict_edits` endpoint from the LLM service,
as it has been superseded by the corresponding endpoint running in
Cloudflare Workers.

All traffic is already being routed to the Cloudflare Workers via the
Workers route, so nothing is hitting this endpoint running in the LLM
service anymore.

You can see the drop off in requests to this endpoint on this graph when
the Workers route was added:

<img width="472" alt="Screenshot 2025-01-30 at 9 18 04 PM"
src="https://github.com/user-attachments/assets/fa60f7c8-2737-4329-88a3-17093bdb5a29"
/>

We also don't use the `fireworks` crate anymore in this repo, so it has
been removed.

Release Notes:

- N/A
2025-01-31 03:21:40 +00:00
Marshall Bowers
35fbe1ef3d
zeta: Send staff edit predictions through llm.zed.dev again (#23996)
This PR changes the edit predictions URL for Zed Staff back to
`llm.zed.dev/predict_edits`.

This endpoint is now being routed to the Cloudflare Workers instead of
the LLM service.

Release Notes:

- N/A
2025-01-30 21:07:38 -05:00
Mikayla Maki
517e519bdc
Make the gpui_tokio crate generic over the context it spawns (#23995)
Part of  #21092

Makes `Tokio::spawn` generic over any `AppContext`.

Also removes a stray `model_context` I missed

Release Notes:

- N/A
2025-01-31 02:00:55 +00:00
Cameron Radmore
ff43b6875b
Add icon association for ESLint flat config (#23994)
Release Notes:

- Added file type associations for ESLint flat config files.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-01-31 01:53:30 +00:00
Joseph T. Lyons
4c8b5ea4f7
Unify selection directions when performing editor: select all selections (#23993)
Closes https://github.com/zed-industries/zed/issues/19569

Current behavior:


https://github.com/user-attachments/assets/1de764c9-7c62-49ad-b24b-6e85760857db

After PR:


https://github.com/user-attachments/assets/651d8e50-95e2-4513-852b-9557d00d2b62

Release Notes:

- Unified selection directions when performing `editor: select all
selections`.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-01-31 01:48:37 +00:00
Marshall Bowers
f29b33ec85
extensions_ui: Show the filtered icon theme selector when installing an icon theme (#23992)
This PR makes it so when you install an extension with icon themes it
will deploy the icon theme selector filtered down to the newly-installed
icon themes.

This is similar to what we do when installing an extension with themes.

Because we can only have one picker open at a time, when installing an
extension that has _both_ themes and icon themes, the theme selector
will take precedence.

Release Notes:

- N/A
2025-01-31 01:32:13 +00:00
Marshall Bowers
e5bc0486b5
Add schema_generator for generating JSON schemas (#23991)
This PR adds a `schema_generator` crate that can be used to generate our
various JSON schemas for publishing elsewhere.

Currently it does the simplest thing possible and just prints the JSON
schema to stdout. We can make this a but more robust later.

I also removed the schema-printing facilities from the `theme_importer`,
as they don't really make sense there.

Release Notes:

- N/A
2025-01-31 01:22:10 +00:00
Max Brunsfeld
b6e54ae2f1
Fix two bugs in new diff hunk handling (#23990)
Closes https://github.com/zed-industries/zed/issues/23981

Release Notes:

- Fixed a crash that could happen when expanding certain diff hunks
- Fixed a bug where diff hunks were not syntax highlighted when
reopening a project with previously-opened buffers.
2025-01-31 01:03:53 +00:00
Mike Qin
9c3482083b
Map window after set_app_id() under X11 (#23046)
GPUI applications can set the window class by the `app_id` window
option. However, GPUI will map the window first and then change the
window class after the window is displayed. This doesn't work on some
X11 window managers. FVWM, for example, does not track window class
after a window is mapped. Because in practice, a window shouldn't change
its application group on the fly.

This PR fixed this by adding a `map_window()` function `PlatformWindow`.
On X11, it will `set_app_id()` first and then map the window.

Release Notes:

- N/A
2025-01-30 16:47:16 -08:00
Shane Friedman
c28a4204ee
Use click event to determine modifier keys (#22988)
Previously, editor elements had to listen for mouse_up events to
determine when a click had completed. This meant that they only had
access to modifier keys that were pressed during the mouse_up event.

This led to some incorrect user experiences, such as executing a
ctrl+click if the user pressed ctrl after pressing the mouse button, but
before releasing it.

This change adds a click event handler to EditorElement, and adds a
modifier() method to the ClickEvent, which only includes the modifier
keys that were pressed during both mouse down and mouse up. The code for
handling link clicks has been moved into the click event handler, so
that it's only triggered when the non-multi-cursor modifier was held for
both the mouse down and mouse up events.

Closes #12752, #16074, #17892 (the latter two seem to be duplicates of
the former!)

Release Notes:

- Fixed a bug where pressing ctrl/cmd (or other modifiers) after mouse
down but before mouse up still triggered ctrl/cmd+click behavior (e.g.
"go to definition")
2025-01-30 16:40:20 -08:00
Marshall Bowers
4892286465
theme_importer: Fix theme JSON schema URL (#23988)
This PR fixes the URL for the theme JSON schema, as it had an extra path
segment.

Release Notes:

- N/A
2025-01-31 00:35:20 +00:00
Marshall Bowers
419780d702
Add support for icon themes (#23987)
This PR adds support for icon themes.

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

Here is Zed with Material Icons:

<img width="1136" alt="Screenshot 2025-01-30 at 7 02 06 PM"
src="https://github.com/user-attachments/assets/57d8a0e0-ff38-44d9-8628-af58a60a7c9a"
/>

### Extensions

Extensions can provide icon themes as well as the icons used in those
themes.

Icon themes are defined as JSON files in the `icon_themes` directory,
and icons included in the `icons` directory will be packaged up with the
extension.

All icon paths within an icon theme are interpreted relative to the root
of the extension.

See the [Material Icon
Theme](https://github.com/zed-extensions/material-icon-theme) extension
for an example.

Release Notes:

- Added support for icon themes.
  - Extensions can now provide icon themes.
- Use the `icon theme selector: toggle` action to switch between
installed icon themes.
2025-01-30 19:08:31 -05:00
Marshall Bowers
7bf4fd6c46
gpui: Move generic bounds to a where clause for better readability (#23985)
This PR moves some generic bounds to a `where` clause to improve the
formatting/readability of the associated `impl` block.

Release Notes:

- N/A
2025-01-30 23:10:05 +00:00
Marshall Bowers
2c950cf7f5
theme: Properly resolve directory and chevron icons from icon themes (#23984)
This PR fixes an issue where we weren't properly resolving directory and
chevron icons from icon themes the way we were for file icons.

We need to interpret the icon paths as relative to the extension
directory.

Release Notes:

- N/A
2025-01-30 22:34:29 +00:00
Michael Sloan
87b0f62041
Implement simpler logic for edit predictions prompt byte limits (#23983)
Realized that the logic in #23814 was more than needed, and harder to
maintain. Something like that could make sense if using the tokenizer
and wanting to precisely hit a token limit. However in the case of edit
predictions it's more of a latency+expense vs capability tradeoff, and
so such precision is unnecessary.

Happily this change didn't require much extra work, just copy-modifying
parts of that change was sufficient.

Release Notes:

- N/A
2025-01-30 15:27:42 -07:00
Marshall Bowers
9d6c0e57a0
extension_cli: Add support for packaging icon themes (#23978)
This PR updates the Zed extension CLI with support for packaging
extensions containing icon themes.

The `icons` directory in the extension will be copied into the packaged
extension to facilitate distributing icon files.

Release Notes:

- N/A
2025-01-30 21:45:04 +00:00
Max Brunsfeld
399e2c1ed3
Revert "project: Fine-grained language server management" (#23977)
Reverts zed-industries/zed#23805
2025-01-30 13:42:56 -08:00
Marshall Bowers
7adf9cb1a0
Add icon theme selector (#23976)
This PR adds an icon theme selector for switching between icon themes:


https://github.com/user-attachments/assets/2cdc7ab7-d9f4-4968-a2e9-724e8ad4ef4d

Release Notes:

- N/A
2025-01-30 16:11:42 -05:00
Agus Zubiaga
e23e03592b
zeta: Onboarding and title bar banner (#23797)
Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: João Marcos <joao@zed.dev>
2025-01-30 16:55:32 -03:00
Marshall Bowers
4ab372d6b5
assistant: Unship tool use (#23969)
This PR unships tool use from Assistant1.

This was only ever partially implemented, and was never released to end
users.

Assistant2 will support tool use.

Release Notes:

- N/A
2025-01-30 19:46:15 +00:00
Szymon Piechaczek
d2828e8722
gpui: Handle Swipe events to support navigation buttons on some mice (#23332)
Closes #14170

To fix this, Zed needs to handle swipe events on its NSView. Logitech
mice don't send the usual Mouse4 and Mouse5 buttons but emulate swipe
gestures according to these websites:
- https://superuser.com/a/1216049
- https://sensible-side-buttons.archagon.net/

Of course, the user can map these buttons to something else in the
device's driver. Most IDEs (VSCode, IntelliJ) handle that correctly by
default so it would be good to follow that pattern.

Since it's my first contribution here, please let me know if I need to
enhance this PR to make it good enough for the main branch.

Release Notes:
 - Fixed mouse navigation buttons on some devices (Logitech, Mac OS)
2025-01-30 11:27:50 -08:00
Marshall Bowers
d1b8fedc9c
prisma: Extract to zed-extensions/prisma repository (#23961)
This PR extracts the Prisma extension to the
[zed-extensions/prisma](https://github.com/zed-extensions/prisma)
repository.

Release Notes:

- N/A
2025-01-30 18:39:34 +00:00
Joe Sweeney
429dbf7129
Pass extra CA certs to node process if env var exists (#23662)
Closes #8650

According to this comment:
https://github.com/zed-industries/zed/issues/8650#issuecomment-2125877549
it fixes the issue as described.

Happy to make adjustments!

Release Notes:
- Added passthrough of `NODE_EXTRA_CA_CERTS` if populated to node
commands
2025-01-30 08:56:02 -08:00
Kirill Bulatov
9e4555797d
Use more LSP data when falling back to regular completions label (#23909)
Closes https://github.com/zed-industries/zed/issues/23590
Closes https://x.com/steeve/status/1865129235536568555

Before:

<img width="773" alt="before"
src="https://github.com/user-attachments/assets/129a8d12-9298-4bf5-8f2d-b3292c2562bf"
/>


After:

<img width="768" alt="after"
src="https://github.com/user-attachments/assets/e0516fb3-b02a-48be-8923-63bba05fdb69"
/>


The list obviously needs some solution for the cut-off part of the
completion label, but this is the reality for all extensions'
completions too, so one step at a time.


Release Notes:

- Improved default completion label fallback
2025-01-30 15:05:34 +00:00
Bennet Bo Fenner
48dba9a9d9
edit prediction: Do not request a completion if edits can be interpolated (#23908)
This ensures that we do not fetch a new completion when the edits of the
user can be interpolated.
E.g. (suggestions in `[]`):
```rust
s[truct Person {}]
```
Then if i type out `truct` we will not fetch a new completion

Release Notes:

- N/A
2025-01-30 14:03:01 +00:00
peanut996
51f07e3382
docs: Update Java extension config example (#23885) 2025-01-30 13:40:51 +00:00
Bennet Bo Fenner
5e210c083f
edit prediction: Fix popover positioning when placed above edit (#23902)
Fixes an off-by-one error when the popover was placed above the edit:
<img width="688" alt="Screenshot 2025-01-30 at 11 59 14"
src="https://github.com/user-attachments/assets/938a6626-3f4d-4566-b68c-89b14d48b68d"
/>


Release Notes:

- N/A
2025-01-30 11:16:56 +00:00
Bennet Bo Fenner
5e449c84fe
edit prediction: Add syntax highlighting for diff popover (#23899)
Co-Authored-by: Antonio <antonio@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2025-01-30 11:53:51 +01:00
Kirill Bulatov
41de83fe1f
Implement collaborative git manipulations (#23869)
Now commit, stage and unstage can be done both via remote ssh and via
collab (by guests with write access).



https://github.com/user-attachments/assets/a0f5e4e8-01a3-402b-a1f7-f3fc1236cffd


Release Notes:

- N/A
2025-01-30 11:23:38 +02:00
Justin Su
e721dac367
Fix counting in default settings (#23898)
Release Notes:

- N/A
2025-01-30 09:08:05 +00:00
Kirill Bulatov
1bc54c2c20
Disable git panel elements for readonly participants (#23897)
Release Notes:

- N/A
2025-01-30 09:07:11 +00:00