Commit graph

19419 commits

Author SHA1 Message Date
Marshall Bowers
e851abd2ec
migrator: Do some cleanup (#24687)
This PR does some clean up of the `migrator` crate:

- Remove `.unwrap`s
- Don't suppress `rustfmt`

Release Notes:

- N/A
2025-02-11 20:46:21 +00:00
Joseph T. Lyons
b3814ce4e3
Fix "Project Diff Opened" event name (#24686)
Release Notes:

- N/A
2025-02-11 20:43:58 +00:00
Nate Butler
2d71733490
ui: Update Label component (#24653)
- Standardize style methods
- Convert label story to a component preview
- update component preview styles  

Release Notes:

- N/A
2025-02-11 20:16:59 +00:00
Marshall Bowers
aab3e0495d
inline_completion_button: Add menu option to toggle "Eager Preview"s for edit predictions (#24685)
This PR adds a menu option to the edit prediction menu to toggle the
"Eager Preview" behavior:

<img width="252" alt="Screenshot 2025-02-11 at 2 44 52 PM"
src="https://github.com/user-attachments/assets/232e879b-3c11-4edd-a549-f284e2bca391"
/>

Release Notes:

- N/A
2025-02-11 20:02:52 +00:00
Mikayla Maki
477cec0ef1
Add more view tracking (#24683)
This should fix a panic in `Window::current_view()`

Release Notes:

- N/A
2025-02-11 19:18:54 +00:00
5brian
0a146793ea
vim: Prevent around word operations from selecting indentation (#24635)
Closes https://github.com/zed-industries/zed/issues/15323

Changes:
Added check for first word on line

Tested `v/c/d/y aw`. Matches standard neovim.

|initial|old|new|
|---|---|---|

|![image](https://github.com/user-attachments/assets/725b74e6-3aa0-40dc-9fd2-4d2b593e9926)|![image](https://github.com/user-attachments/assets/eeebd267-b4c6-4ea6-bb9a-fb913614754c)|![image](https://github.com/user-attachments/assets/fb695e54-b4c2-44a6-a588-909c1fd415e0)



Release Notes:

- vim: Prevent around word operations from selecting indentation
2025-02-11 11:35:59 -07:00
Peter Tripp
7378ab9ba5
Correctly handle [[ autoclosing in Markdown (#24662) 2025-02-11 13:06:45 -05:00
Cole Miller
759ea0ec48
Touch up stale hunks fix (#24669)
Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2025-02-11 17:47:41 +00:00
João Marcos
7c00eec08b
edit predictions: Fix popover hint not scrolling horizontally (#24602)
Release Notes:

- N/A
2025-02-11 17:29:00 +00:00
Marshall Bowers
eaab7da2d8
zeta: Add ability to change predict edits URL via environment variable (#24668)
This PR adds the ability to change the predict edits URL using the
`ZED_PREDICT_EDITS_URL` environment variable.

This allows for easily pointing Zed to a development version of the
Cloudflare Worker.

Release Notes:

- N/A
2025-02-11 17:28:13 +00:00
Agus Zubiaga
14d9788ba3
edit predictions: Don't animate cursor when jumping in eager mode without LSP completions (#24664)
We should only do this in "holding modifier" mode OR when there's a
language server completions menu.

Release Notes:

- N/A
2025-02-11 16:47:34 +00:00
Cameron Radmore
b395beaf93
file_icons: Add Stylelint file icon associations (#24605)
This PR adds file associations for stylelint files.

This is how it looks like in Zed (the icon doesn't exist):
![default javascript file icon is shown for
stylelint.config.js](https://github.com/user-attachments/assets/a873d7fc-1b8a-4a9c-8e92-1be56d5b01b1)

In a dev version of an icon theme it looks like this (icon sourced from:
https://github.com/vscode-icons/vscode-icons/blob/master/icons/file_type_stylelint.svg
):
![stylelint file icon is shown for
stylelint.config.js](https://github.com/user-attachments/assets/ddbb068d-7986-43de-94f8-9c844cb6b96f)

Release Notes:

- Icon themes: Added Stylelint file icon associations.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-11 16:42:54 +00:00
Cole Miller
6e7416eb00
Fix stale hunks after commit (#24663)
Fixes a regression introduced in #24475.

Release Notes:

- N/A
2025-02-11 11:39:57 -05:00
smit
bbea3a2184
editor: Fix crash caused by editor::SelectPrevious (#24660)
Closes #24345

Release Notes:

- Fixed a crash caused by calling `editor::SelectPrevious` twice in a
row.

Co-authored-by: conrad <conrad@zed.dev>
2025-02-11 22:07:44 +05:30
ANKDDEV
7fe6943d89
Add command to copy current file name (#22174)
Closes #21967

Add actions `CopyFileName` and `CopyFileNameWithoutExtension` to be used in the command palette.

Release Notes:

- Added commands `editor: copy file name` and `editor: copy file name without extensions`.
2025-02-11 12:42:23 -03:00
Bennet Bo Fenner
8fa85c41a1
edit prediction: Try to fix panic in Buffer::preview_edits (#24654)
We've seen a few crashes in `SyntaxSnapshot::reparse_with_ranges` during
`Buffer::preview_edits`, where an offset conversion fails because it is
out of range.
We are not sure how exactly this is happening. 
Our theory is that the syntax snapshot is using an outdated state when
edits happen in the meantime (while interpolating). This is an attempt
to see if it helps with the panics, hopefully we can revisit this when
we have a better understanding of the issue.


Co-Authored-by: Antonio <antonio@zed.dev>

Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
2025-02-11 16:35:09 +01:00
Marshall Bowers
7b45901d96
gpui: Update asset paths for more examples (#24646)
This PR updates the asset paths used in more GPUI examples such that
they work when run from the repository root or from within
`crates/gpui`.

Release Notes:

- N/A
2025-02-11 14:37:55 +00:00
Agus Zubiaga
22e2b8e832
edit predictions: Preview jumps by animating cursor to target (#24604)
https://github.com/user-attachments/assets/977d08fb-a2b1-4826-9d95-8f35c6cb9f13




Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Smit <smit@zed.dev>
Co-authored-by: Max <max@zed.dev>
2025-02-11 11:19:51 -03:00
Marshall Bowers
5778e1e6f0
theme: Fix Svelte file icon (#24650)
This PR fixes the file icon used for Svelte files in the default icon
theme, as I used the wrong icon name in #24644.

Release Notes:

- N/A
2025-02-11 14:09:03 +00:00
Marshall Bowers
c61f2dff47
file_icons: Use a separate icon key for Markdown files (#24648)
This PR updates the file icon mappings such that Markdown (`.md`,
`.markdown`) files map to the `markdown` key.

Release Notes:

- Icon themes: Added the ability to change the file icon for Markdown
(`.md`, `.markdown`) files.
2025-02-11 13:58:53 +00:00
Marshall Bowers
04d65cb3cd
gpui: Make image example work regardless of how it is run (#24645)
This PR updates the GPUI `image` example such that it works when run in
the following ways:

- `cargo run -p gpui --example image` from the repository root
- `cargo run --example image` from within `crates/gpui`

Release Notes:

- N/A
2025-02-11 13:34:38 +00:00
Marshall Bowers
6a40a400bd
file_icons: Use a separate icon key for Svelte files (#24644)
This PR updates the file icon mappings such that Svelte (`.svelte`)
files map to the `svelte` key.

Release Notes:

- Icon themes: Added the ability to change the file icon for Svelte
(`.svelte`) files.
2025-02-11 13:22:23 +00:00
Piotr Osiewicz
64ae5093af
chore: Remove settings dependency on migrator (#24642)
Closes #ISSUE

Release Notes:

- N/A
2025-02-11 13:34:33 +01:00
zfx
7f4957cf20
Remove non-existent icon IndicatorX (#24636)
There is no file indicator_x.svg in the assets directory.

09:49:05 [ERROR] could not find asset at path "icons/indicator_x.svg"

![image](https://github.com/user-attachments/assets/e9cc5ae3-4eb3-4e1e-b012-43ac7297c0a7)

Release Notes:

- N/A
2025-02-11 11:32:38 +00:00
Bennet Bo Fenner
8c349057e5
edit prediction: Fix zeta: Rate completions action not working when using keybinding (#24569)
Release Notes:

- N/A
2025-02-11 12:14:42 +01:00
5brian
236f51cddd
vim: Update vi{ (#24601)
Small fix: Following up on
https://github.com/zed-industries/zed/pull/24518 where i missed `vi{`.

Matching neovim(tree-sitter), `vi{` should not have the newline selected
(Now `vi{d`/`vi{c` can match `di{`/`ci{`).

Also moved the cursor to the start.

|prev|new|neovim|
|---|---|---|

|![image](https://github.com/user-attachments/assets/0311fbe5-df2e-4feb-977d-de33a3af7fdc)|![image](https://github.com/user-attachments/assets/a940c6ba-268b-4401-8c43-38ca17848542)|![image](https://github.com/user-attachments/assets/dab2c47d-660c-4ae3-bf79-635265222cc1)|

Release Notes:

- N/A
2025-02-10 22:26:26 -07:00
Max Bucknell
37785a54d5
vim: :set support (#24209)
Closes #21147 

Release Notes:

- vim: First version of `:set` with support for `[no]wrap`,
`[no]number`, `[no]relativenumber`

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-11 04:55:40 +00:00
Cole Miller
8f75fe25e5
Add staged status information to diff hunks (#24475)
Release Notes:

- Render unstaged hunks in the project diff editor with a slashed
background

---------

Co-authored-by: maxbrunsfeld <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-02-10 21:43:25 -05:00
Michael Sloan
4c881b6a12
Use editor::AcceptEditPrediction in vim keymap (#24596)
* Overrides the action handler to switch to insert mode after jumps.

* Returns `vim::Tab` to its behavior from before #24418

Release Notes:

- N/A

Co-authored-by: Conrad <conrad@zed.dev>
2025-02-10 19:20:13 -07:00
Danilo Leal
c89ad65782
edit predictions: Show user if current project is open source (#24587)
Release Notes:

- N/A

---------

Co-authored-by: João Marcos <marcospb19@hotmail.com>
2025-02-10 22:28:56 -03:00
Michael Sloan
3d9f70946c
Use last keybind (highest precedence) for AcceptEditPrediction display (#24595)
Fix of PR #24582

Release Notes:

- N/A
2025-02-11 01:12:46 +00:00
张小白
c1f162abc6
collab: Fix project sharing between Windows and Unix (#23680)
Closes #14258

Windows user(host) sharing a project to a guest(using macOS), and host
follows guest:


https://github.com/user-attachments/assets/ba306b6b-23f7-48b1-8ba8-fdc5992d8f00

macOS user(host) sharing a project to a guest(using Windows), and host
follows guest:



https://github.com/user-attachments/assets/c5ee5e78-870d-49e5-907d-8565977a01ae

macOS user edits files in a windows project through collab:



https://github.com/user-attachments/assets/581057cf-e7df-4e56-a0ce-ced74339906a





Release Notes:

- N/A
2025-02-10 16:12:01 -08:00
Max Brunsfeld
929c5e76b4
Fix some visual bugs w/ edit predictions (#24591)
* correct the size of key binding icons
* avoid spurious modifier in 'jump to edit' popover when already
previewing
* fix height of the edit preview popover

Release Notes:

- N/A

Co-authored-by: agu-z <hi@aguz.me>
2025-02-10 23:49:08 +00:00
Ben Kunkle
dab9c41799
Fix formatters not running in order (#24584)
Previously, if multiple formatters were specified for the same language,
they would be run in parallel on the state of the file, and then all
edits would be applied. This lead to incorrect output with many unwanted
artifacts.
This PR refactors the formatting code to clean it up, and ensure results
from previous formatters are passed in to subsequent formatters.

Closes #15544

Release Notes:

- Fixed an issue where when running multiple formatters they would be
ran in parallel rather than sequentially, leading to unwanted artifacts
and incorrect output.

---------

Co-authored-by: Conrad <conrad@zed.dev>
2025-02-10 16:18:14 -06:00
Agus Zubiaga
1f288f7327
edit predictions: Fix predictions bar disappearing while loading (#24582)
Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2025-02-10 21:49:46 +00:00
Agus Zubiaga
0af048a7cf
edit predictions: Cache settings across renders (#24581)
We were reading edit prediction settings too often, causing frames to be
dropped. We'll now cache them and update them from
`update_visible_inline_completion`.

Release Notes:

- N/A
2025-02-10 20:57:25 +00:00
Conrad Irwin
973cb916f3
Fix fill-co-authors, and collaborator cursors (#24575)
Co-authored-by: mikayla-maki <mikayla.c.maki@gmail.com>

Release Notes:

- N/A

Co-authored-by: mikayla-maki <mikayla.c.maki@gmail.com>
2025-02-10 13:57:07 -07:00
Michael Sloan
63c0150cc2
Fix handling of holding modifier to show edit prediction (#24580)
Meant to include this in #24442

Release Notes:

- N/A
2025-02-10 13:39:03 -07:00
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
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