ZIm/crates/languages/src/rust
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
..
brackets.scm vim: Update anyquotes and anybrackets to behave like mini.ai plugin (#24167) 2025-02-17 14:55:48 -07:00
config.toml language: Update block_comment and documentation comment (#34861) 2025-07-23 20:38:52 +05:30
debugger.scm debugger: Generate inline values based on debugger.scm file (#33081) 2025-06-24 18:24:43 +00:00
embedding.scm chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
highlights.scm Capture shorthand_field_initializer and modules in Rust highlights (#35842) 2025-08-22 20:16:43 +00:00
indents.scm chore: Extract languages from zed crate (#8270) 2024-02-23 15:56:08 +01:00
injections.scm rust: Add injection for leptos view macro (#30710) 2025-05-14 16:48:22 +00:00
outline.scm Revert accidental change to Rust outline files (#21545) 2024-12-04 11:58:56 -07:00
overrides.scm Add inclusive range scope overrides. Don't auto-close quotes at the ends of line comments (#20206) 2024-11-04 15:36:39 -08:00
runnables.scm rust: Improve runnable detection for test modules (#28024) 2025-04-03 14:56:28 +00:00
textobjects.scm Add textobjects queries (#20924) 2024-12-03 10:37:01 -07:00