ZIm/crates/languages/src
Jonathan Andersson 896a35f7be
Capture shorthand_field_initializer and modules in Rust highlights (#35842)
Currently shorthand field initializers are not captured the same way as
the full initializers, leading to awkward and mismatching highlighting.
This PR addresses this fact, in addition to capturing new highlights:
- Tags the `!` as part of a macro invocation.
- Tags the identifier part of a lifetime as `@lifetime`.
- Tag module definitions as a new capture group, `@module`.
- Shorthand initializers are now properly tagged as `@property`.

Here's what the current version of Zed looks like:

<img width="596" height="683" alt="image"
src="https://github.com/user-attachments/assets/c9e52d8e-03dc-426b-8545-4fe872b803e0"
/>

With the new highlighting applied:

<img width="596" height="683" alt="image"
src="https://github.com/user-attachments/assets/b7bd9391-9910-456b-8198-6871174d0f4f"
/>

Release Notes:

- Improved highlighting of Rust files, including new highlight groups
for modules and shorthand initializers.
2025-08-22 20:16:43 +00:00
..
bash Add more string and comment overrides (#36566) 2025-08-20 09:29:53 +00:00
c language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
cpp outline: Fix nesting in multi-name declarations in Go and C++ (#36076) 2025-08-12 21:08:19 +00:00
css language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
diff Improve diff syntax highlighting queries (#21740) 2024-12-12 15:18:36 -08:00
gitcommit git_ui: Fix list in git commit message (#33409) 2025-07-01 08:05:08 -04:00
go outline: Fix nesting in multi-name declarations in Go and C++ (#36076) 2025-08-12 21:08:19 +00:00
gomod Add "tool" support to go.mod (#22995) 2025-01-15 17:44:28 +02:00
gowork File context for assistant panel (#9712) 2024-03-29 13:55:01 -07:00
javascript outline: Fix nesting in multi-name declarations in Go and C++ (#36076) 2025-08-12 21:08:19 +00:00
jsdoc Add JSDoc scope (#29476) 2025-06-06 08:31:59 -04:00
json debugger: Run debug scenarios from package.json (#32958) 2025-06-18 20:04:25 +02:00
jsonc Add more string and comment overrides (#36566) 2025-08-20 09:29:53 +00:00
markdown language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
markdown-inline Hide Markdown-Inline language from users with a new 'hidden' flag on language configs (#17104) 2024-08-29 11:23:33 -07:00
python languages: Fix detents case line after typing : in Python (#34017) 2025-07-07 22:41:29 +05:30
regex Improve Regex highlighting (#28183) 2025-04-18 12:44:13 -04:00
rust Capture shorthand_field_initializer and modules in Rust highlights (#35842) 2025-08-22 20:16:43 +00:00
tsx outline: Fix nesting in multi-name declarations in Go and C++ (#36076) 2025-08-12 21:08:19 +00:00
typescript outline: Fix nesting in multi-name declarations in Go and C++ (#36076) 2025-08-12 21:08:19 +00:00
yaml Add more string and comment overrides (#36566) 2025-08-20 09:29:53 +00:00
zed-keybind-context keymap_ui: Create language for Zed keybind context (#34558) 2025-07-16 17:00:47 +00:00
bash.rs Fix aggressive indent in shell scripts (#31973) 2025-06-03 10:50:58 -04:00
c.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
css.rs Fix clippy::needless_borrow lint violations (#36444) 2025-08-18 21:54:35 +00:00
github_download.rs Fix clippy::needless_borrow lint violations (#36444) 2025-08-18 21:54:35 +00:00
go.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
json.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
lib.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
package_json.rs debugger: Fix issues with debugging scripts from package.json (#32995) 2025-06-19 14:33:24 +00:00
python.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
rust.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
tailwind.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
typescript.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
vtsls.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00
yaml.rs Fix clippy::redundant_clone lint violations (#36558) 2025-08-20 12:20:13 +02:00