Commit graph

25238 commits

Author SHA1 Message Date
Michael Sloan
78a5cf0257
Fix display of bindings for editor::AcceptInlineCompletion + add validation + use modifiers from keymap (#24442)
Release Notes:

- N/A
2025-02-10 13:01:42 -07:00
Michael Sloan
43afa68dab
Make migration notification not display if some bug causes no changes (#24578)
When working on #24442, I did a project wide replacement of
`AcceptInlineCompletion` with `AcceptEditPrediction`, as I was updating
the branch to mmain and that rename had happened. This also replaced it
in the migrator, causing the migration notification to always pop up on
keymap changes.

Checking if the migration actually changes the text makes it behave
better if this variety of bug happens in the future.

Release Notes:

- N/A
2025-02-10 13:01:10 -07:00
Finn Evers
0fd2203665
context_menu: Use when instead of if-block (#24566)
See
https://github.com/zed-industries/zed/pull/24562#issuecomment-2648343416
. Should have just added that to my original comment btw - sorry!

CC @danilo-leal 

Release Notes:

- N/A
2025-02-10 16:47:09 -03:00
Liam Murphy
72e1947025
Update tree-sitter to 0.24 (#24492)
I didn't update it to 0.25 because its Wasm support seems to be
partially broken due to
https://github.com/tree-sitter/tree-sitter/pull/3938: it didn't
introduce a check that the Wasm module's ABI is new enough to include
supertype info while parsing it, and so in the case where it isn't it
ends up interpreting random bytes as the number of supertypes, causing
out-of-bounds memory accesses.

Closes #24489

Release Notes:

- Fixed a rare crash during syntax highlighting
2025-02-10 10:52:27 -08:00
Max Brunsfeld
d9909c691d
Fix panic when outline items have no name (#24574)
Closes #23787

Release Notes:

- Fixed a crash when searching the outline view in certain Ruby files.
2025-02-10 18:50:26 +00:00
Kirill Bulatov
4f7200527c
Revert "Fix editor::GoToDiagnostics cycle (#24446)" (#24568)
This reverts commit 4f65cfa93d.

Release Notes:

- N/A
2025-02-10 17:13:12 +00:00
Nate Butler
de8d4d00ce
git_ui: Update git panel commit editor, start on quick commit
- Fixes commit editor issues & updates style
- Starts on quick commit (not hooked up to anything)
- Updates some panel styles
- Adds SwitchWithLabel
- 
Release Notes:

- N/A
2025-02-10 15:52:09 +00:00
5brian
69d415c8d0
vim: Multiline operation improvements (#24518)
Closes #15711

Discussed changes to match neovim in
https://github.com/zed-industries/zed/pull/24481#issuecomment-2644504695
-- `vi{` matches neovim with treesitter instead of vanilla neovim.
Change and delete matches standard neovim.

Not sure if this is the best way to do it, implemented post processing
to change and delete objects.
I think another way would be adjust the range to trim the trailing
newline char on change and delete operations, instead of having to add
it back.

||Before|After|
|---|---|---|

|initial|![image](https://github.com/user-attachments/assets/0bab37b7-c0ac-4992-a365-b7ec304a6800)||
| `vi{` |
![image](https://github.com/user-attachments/assets/4c802fcd-fa7e-45ba-b7d4-3283ed538e10)
|
![image](https://github.com/user-attachments/assets/4394bb6e-418b-4463-9737-f9bdfc6d31c2)
|
| `ci{` |
![image](https://github.com/user-attachments/assets/b5eabb58-4a93-4c98-80b6-f34a6525b1fb)
|
![image](https://github.com/user-attachments/assets/79af57e4-260c-4432-af66-eba5285d97a0)
|
| `di{` |
![image](https://github.com/user-attachments/assets/190a70e7-71fd-47fe-9d6c-2082f2034d0f)
|
![image](https://github.com/user-attachments/assets/775b86a9-68c1-4397-a44b-c645a772de63)
|

Release Notes:

- vim: Improved multi-line operations
2025-02-10 08:45:06 -07:00
Danilo Leal
d292b7c96d
context menu: Use invisible() to hide the check icon (#24562)
Follow up to: https://github.com/zed-industries/zed/pull/24549

Release Notes:

- N/A
2025-02-10 12:16:33 -03:00
Piotr Osiewicz
ca4378cbaa
ui: Use cursor: pointer for Toggles (#24563)
Closes #ISSUE

Release Notes:

- N/A
2025-02-10 15:10:35 +00:00
Finn Evers
d42322ab06
php: Update brackets.scm (#24558)
Closes #24550 
Adds some missing brackets to the PHP language extension.
2025-02-10 09:42:16 -05:00
Danilo Leal
3f0288e52a
docs: Add a light border to h2s (#24554)
I was finding hard to navigate the "Configuring Zed" page with just
white space creating a boundary between the different chunks of content.
I think a slight border below the h2 heading helps a lot with that!

Release Notes:

- N/A
2025-02-10 09:43:51 -03:00
Danilo Leal
d15a61a1aa
context menu: Adjust toggleable entry label alignment (#24549)
Previously, we were passing an `IconSize` that had a default size. Given
the check icon is small by default, when the entry is not toggled, that
caused a slight misalignment between the toggled and not-toggled items.
I'm passing now the same icon element but inside an opacity 0 div. Open
to other suggestions if this feels clunky.

| Before | After |
|--------|--------|
| <img width="946" alt="Screenshot 2025-02-10 at 7 58 28 AM"
src="https://github.com/user-attachments/assets/4d2b3f12-72c5-4c8d-acaf-c16230250560"
/> | <img width="943" alt="Screenshot 2025-02-10 at 7 58 37 AM"
src="https://github.com/user-attachments/assets/2df64752-7273-4bdc-9f6b-5153ed52c889"
/> |

Release Notes:

- N/A
2025-02-10 08:19:58 -03:00
Danilo Leal
e72f7b4e22
edit predictions: Put back status bar button tooltips (#24548)
These were wrongly removed in
https://github.com/zed-industries/zed/pull/24540; putting them back.

cc @SomeoneToIgnore 

Release Notes:

- N/A
2025-02-10 08:19:46 -03:00
Libon
d0c4c664b0
Brighten yellow and black terminal colors in One themes (#24420)
Closes https://github.com/zed-industries/zed/issues/24419

I made some fine adjustments to the color of the theme with reference
to' Window Terminal' to make it look good. If there is anything
inappropriate in this revision, please also point it out. :)


![window-terminal-one-light](https://github.com/user-attachments/assets/86c4002f-a5a7-4ab1-81de-e6ed0529fe06)

![window-terminal-one-dark](https://github.com/user-attachments/assets/c57095d7-0131-4978-ae6d-7105639110b5)

Release Notes:
- N/A
2025-02-10 11:03:47 +00:00
CharlesChen0823
994bea0003
workspace: Fix pane focus transfer when closing another pane (#23175)
Closes #23123 

Only close current active_pane should move focus to other pane.

Release Notes:

- N/A
2025-02-10 11:54:06 +02:00
Kirill Bulatov
6f7f0f30e2
Fix hover tooltips appearing after related element is pressed (#24540)
Closes https://github.com/zed-industries/zed/issues/23894

Reworks all trigger declarations from
`.trigger(element.tooltip(tooltip))` into
`.trigger_with_tooltip(element, tooltip)` , with new API disallowing
simultaneous trigger and tooltip display.

All existing `.trigger(` calls were replaced, except 2 not applicable
(in dock.rs and pane.rs), 15 left as ones without tooltips, and 2
unchanged places in `inline_completion_button.rs`, where


0f7bb2e9fd/crates/inline_completion_button/src/inline_completion_button.rs (L311-L319)

`with_animation` does not allow us to simply use the same approach.

Release Notes:

- Fixed hover tooltips appearing after related element is pressed

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-02-10 00:16:12 +00:00
Michael Sloan
1a133ab9d8
Settings/keymap backup path next to files + update notification messages (#24517)
Before:


![image](https://github.com/user-attachments/assets/5b7d8677-b0db-4a66-ac30-e4751ba4182d)

After:


![image](https://github.com/user-attachments/assets/94743bc2-2902-43a3-8d6e-e0e0e6e469ec)

Release Notes:

- N/A
2025-02-09 16:51:37 -07:00
Kirill Bulatov
cf74d653bd
Fix outline panel issues in a multi-worktree set-up (#24538)
Closes https://github.com/zed-industries/zed/issues/22993

Properly calculates depth and maintains worktree order, when displaying
multiple worktrees in the outline panel.

Release Notes:

- Fixed outline panel issues in a multi-worktree set-up
2025-02-09 21:29:29 +00:00
Nate Butler
8f1ff189cc
component: Add component and component_preview crates to power UI components (#24456)
This PR formalizes design components with the Component and
ComponentPreview traits.

You can open the preview UI with `workspace: open component preview`.

Component previews no longer need to return `Self` allowing for more
complex previews, and previews of components like `ui::Tooltip` that
supplement other components rather than are rendered by default.

`cargo-machete` incorrectly identifies `linkme` as an unused dep on
crates that have components deriving `IntoComponent`, so you may need to
add this to that crate's `Cargo.toml`:

```toml
# cargo-machete doesn't understand that linkme is used in the component macro
[package.metadata.cargo-machete]
ignored = ["linkme"]
```

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-09 13:25:03 -05:00
Agus Zubiaga
56cfc60875
ui: Add buffer_font method to labels (#24479)
Now you don't need to wrap the `Label` in a `div` anymore 

Release Notes:

- N/A

Co-authored-by: Danilo <danilo@zed.dev>
2025-02-09 15:23:39 -03:00
Kirill Bulatov
6ee447ee58
Move focus into editor for outline_panel::Open action on outlines and search results (#24535)
Follow-up of
https://github.com/zed-industries/zed/discussions/19782#discussioncomment-12055976

Release Notes:

- Fixed outline panel not focusing editor when outlines and search
results were opened with `outline_panel::Open`
2025-02-09 17:27:41 +00:00
Marshall Bowers
f42177a912
ci: Pin Prettier to a specific version for docs formatting (#24531)
This PR pins Prettier to a specific version when we run the docs
formatting check.

This should prevent drift when new Prettier versions are released that
may impact the formatting.

Release Notes:

- N/A
2025-02-09 16:46:33 +00:00
Marshall Bowers
072d2b061a
ui: Remove ToolStrip component (#24529)
This PR removes the `ToolStrip` component.

Pulling this change out of
https://github.com/zed-industries/zed/pull/24456.

Release Notes:

- N/A
2025-02-09 16:07:40 +00:00
Caleb!
065fdcb86b
language_tools: Add background color to syntax tree view (#24524)
Closes #22830 

@jansol, please take a look. I don't know if this is correct as I
couldn't really tell the difference. I just added the active theme's
background color to the main container of the tree view.

<img width="1309" alt="Screenshot 2025-02-09 at 10 29 15 AM"
src="https://github.com/user-attachments/assets/dadf9333-0074-4bfa-bb06-ed4c4f275200"
/>
 
Release Notes:

- Added an explicit background color to the syntax tree view.

cc: @iamnbutler

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-09 15:54:14 +00:00
Henrikh Kantuni
e84d77e879
Fix typo in elm.md (#24519)
Removes duplicate mention of `elm`.
2025-02-09 11:43:09 +02:00
smit
f1693e6129
project_panel: Fix worktree root rename (#24487)
Closes #7923

This PR fixes root worktree renaming by:  

1. Handling the case where `new_path` is the new root name instead of a
relative path from the root.
2. [#20313](https://github.com/zed-industries/zed/pull/20313) added
functionality to watch for root worktree renames made externally, e.g.,
via Finder. This PR avoids relying on that watcher because, when
renaming explicitly from Zed, we can eagerly perform the necessary work
(of course after fs rename) instead of waiting for the watcher to detect
the rename. This prevents UI glitches during renaming root.

Todo:

- [x] Fix wrong abs paths when root is renamed
- [x] Fix explicit scan entry func to handle renamed root dir
- [x] Tests
- [x] Test on Linux
- [x] Tested with single and multipe worktrees
- [x] Tested when single file is root file

Release Notes:

- Fixed an issue where worktree root name couldn't be renamed in project
panel.
2025-02-09 14:16:27 +05:30
Affan Shahid
4207b194e3
docs: Fix typo in the Icon Themes page (#24516)
Release Notes:

- N/A
2025-02-08 18:35:43 -05:00
Marshall Bowers
fe6d180a1a
Sort Prettier files in file_types.json (#24505)
This PR sorts the Prettier files added in #24496.

Release Notes:

- N/A
2025-02-08 16:11:31 +00:00
João Marcos
0294b19694
Track caller on <usize as ToOffset>::to_offset (#24503)
To get useful logs when reporting bugs involving offsets out of range

Release Notes:

- N/A
2025-02-08 15:29:29 +00:00
Kirill Bulatov
b1055878c7
Improve outline panel initial update (#24500)
Closes https://github.com/zed-industries/zed/issues/24128

* removed unnecessary debounces when updating the panel data
* removed all "loading"-related messages to snow nothing when initial
data is loaded, thus reducing flickering

Release Notes:

- Improved outline panel initial update
2025-02-08 12:33:47 +00:00
Sanjeev Shrestha
3582fc4636
File icons add icon association for Prettier config (#24496)
This PR adds icon association for more Prettier's config files.

Here is the list:

```
.prettierrc.cjs
.prettierrc.js
.prettierrc.json5
.prettierrc.mjs
.prettierrc.toml
.prettierrc.yaml
.prettierrc.yml
prettier.config.cjs
prettier.config.js
prettier.config.mjs
```

Release Notes:

- Added icon support for additional Prettier config file types.
2025-02-08 17:03:01 +05:30
Mikayla Maki
ca4e8043d4
Add branch to git panel (#24485)
This PR adds the branch selector to the git panel and fixes a few bugs
in the repository selector.

Release Notes:

- N/A

---------

Co-authored-by: ConradIrwin <conrad.irwin@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
2025-02-08 03:27:58 +00:00
roycrippen4
d9183c7669
vim: Escape to normal mode when visual surround operation pending (#24484)
Closes #24382

Release Notes:
Added a default keymap that returns the user to `normal` mode after
pressing escape during a pending `visual-surround` operation.

- N/A

---------

Co-authored-by: roy.crippen4 <roy.crippen4@archarithms.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-07 20:23:10 -07:00
5brian
7bddb390ca
vim: Preserve trailing whitespace in inner text object selections (#24481)
Closes #24438

Changes: Adjusted loop to only trim whitespace between last newline and
closing marker, when using inner objects like `y/d/c i b`

| Start   | Fixed `vib`   | Previous `vib`   |
| ---------- | ---------- | ---------- |
|
![image](https://github.com/user-attachments/assets/3d64dd7d-ed3d-4a85-9f98-f2f83799a738)
|
![image](https://github.com/user-attachments/assets/841beb59-31b1-475e-93f0-f4deaf18939c)
|
![image](https://github.com/user-attachments/assets/736d4c6f-20e1-4563-9471-1e8195455df4)
|



Release Notes:

- vim: Preserve trailing whitespace in inner text object selections

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-08 02:50:34 +00:00
Michael Sloan
146b9c232c
Sort and dedupe .gitignore files (#24491)
Release Notes:

- N/A
2025-02-08 02:17:17 +00:00
Michael Sloan
be26acccca
Cargo.lock update (#24486)
Release Notes:

- N/A
2025-02-08 00:18:20 +00:00
Beniamin Zagan
4be89ea60f
title_bar: Add menu item to deploy icon theme selector (#24482)
Added the icons option in the title bar between Themes and Extension.

| Before | After |
|
---------------------------------------------------------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------------------------------------------------------
|
| <img width="215" alt="Screenshot 2025-02-07 at 5 18 10 PM"
src="https://github.com/user-attachments/assets/ff8bf5ce-c176-4d8c-8b0e-bb1cc65ec1d8"
/> | <img width="206" alt="Screenshot 2025-02-07 at 5 18 01 PM"
src="https://github.com/user-attachments/assets/c47a302e-98af-4530-a908-097b8306f2f0"
/> |

Release Notes:

- Added an option to open the icon theme selector from the user menu.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-07 22:33:00 +00:00
Marshall Bowers
e17e838c07
Include prediction ID on edit prediction accepted/discarded events (#24480)
This PR updates the edit predictions to include the prediction ID
returned from the server on the resulting telemetry events indicating
whether the prediction was accepted or discarded.

The `prediction_id` on the events can then be correlated with the
`request_id` on the server-side prediction events.

Release Notes:

- N/A
2025-02-07 22:06:37 +00:00
Marshall Bowers
ed5656813c
inline_completion: Add missing punctuation (#24477)
This PR adds some missing punctuation.

Release Notes:

- N/A
2025-02-07 21:03:37 +00:00
Danilo Leal
c4bcff1e87
edit predictions: Add binding to the prediction toggle (#24468)
This PR primary goal is to add a keybinding to the (ephemeral)
prediction toggle. In doing that, we also standardized the keybinding to
open the status bar menu with it.

Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
2025-02-07 18:01:39 -03:00
Danilo Leal
07f1b612cf
edit predictions: Fix translucent "jump to edit" background color (#24473)
This PR uses a pretty cool GPUI method called `blend` to make this
callout's background color not translucent.

| Before | Header |
|--------|--------|
| <img width="732" alt="Screenshot 2025-02-07 at 4 58 16 PM"
src="https://github.com/user-attachments/assets/2a5df61b-dfa0-4edc-bffa-a605a2aa491a"
/> | <img width="732" alt="Screenshot 2025-02-07 at 4 56 48 PM"
src="https://github.com/user-attachments/assets/5dee9fca-6239-4ae0-80f5-dcc6abf0e779"
/> |

Release Notes:

- N/A
2025-02-07 17:58:20 -03:00
Marshall Bowers
9e5bc81f1c
zeta: Promote line comment to doc comment (#24476)
This PR promotes a line comment for the `tos_accepted` field to a doc
comment.

Release Notes:

- N/A
2025-02-07 20:57:42 +00:00
Conrad Irwin
7148092e12
Fix adding new git repos to a project (#24471)
Release Notes:

- N/A
2025-02-07 20:08:09 +00:00
Jason Lee
ead5a836a1
gpui: Add data table example (#24373)
Release Notes:

- N/A

As https://github.com/zed-industries/zed/discussions/24260 I mentioned
issue.

Make a complex data table example to test the text rendering
performance.

This example also can be an example to show how to build a large data
table.

```bash
cargo run -p gpui --example data_table
```

<img width="2004" alt="image"
src="https://github.com/user-attachments/assets/653771e5-ef08-4d76-97b9-90ea4b78be59"
/>

----

I will try to do some test. 

For example: With a threshold for the hold number of caches in
`FrameCache`, and only when the threshold is greater than a certain
number, some caches are released, or when a certain time has passed. I
am not sure if this is feasible.

This example is added to help us to test.
2025-02-07 11:54:34 -08:00
Conrad Irwin
3be8066415
Newlines in commit editor (#24465)
Release Notes:

- N/A
2025-02-07 12:31:12 -07:00
Antonio Scandurra
f6e396837c
Re-introduce syntax-based context and use new model (#24469)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2025-02-07 19:19:57 +00:00
Agus Zubiaga
fd7fa87939
edit predictions: Restore red dot in status buttons when pending ToS (#24408)
In one of the recent changes to the edit predictions status bar menu, we
lost the red dot that is displayed when the user has Zed as the provider
but hasn't accepted terms of service. Note: All the checks were still in
place, just the visual indicator was missing.

![CleanShot 2025-02-06 at 20 22
21@2x](https://github.com/user-attachments/assets/da8f25dd-5ed2-4bf9-8453-10b80f00bf63)


Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-02-07 15:42:27 -03:00
Danilo Leal
a7a14e59bf
edit predictions: Clarify disabled_globs documentation (#24460)
This PR clarifies how the `disabled_globs` work.

Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
2025-02-07 19:35:55 +01:00
Marshall Bowers
8ff8dbdb2b
assistant_context_editor: Fix patch block not rendering due to window reborrow (#24461)
This PR fixes an issue where the Assistant patch block was not being
rendered when using "Suggest Edits".

The issue was that the `BlockContext` already has a borrow of the
`Window`, so we can't use `update_in` to reborrow the window.

The fix is to reuse the existing `&mut Window` reference from the
`BlockContext` so we don't need to `update_in`.

Closes #24169.

Release Notes:

- Assistant: Fixed an issue where the patch block was not being rendered
when using "Suggest Edits".

---------

Co-authored-by: Max <max@zed.dev>
2025-02-07 18:03:19 +00:00