zed icon indicating copy to clipboard operation
zed copied to clipboard

Improve rust syntax highlighting.

Open gloridifice opened this issue 1 year ago • 2 comments

Check for existing issues

  • [X] Completed

Describe the feature

Some improvement points I found of zed rust syntax highlighting are below.

lifetime

Color rust lifetime.

Zed ⬇️ Snipaste_2024-02-12_12-14-01

RustRover (Expected) ⬇️ Snipaste_2024-02-12_12-30-06 Snipaste_2024-02-12_12-36-37

generic

Color generic with a separate color. (now it's same as "type") Zed ⬇️ Snipaste_2024-02-12_12-29-20 RustRover (Expected) ⬇️ Snipaste_2024-02-12_12-28-25

proc macro

Color proc macros with a separate color. (Now it's same as "editor.foreground") Zed ⬇️ Snipaste_2024-02-12_12-14-20 Snipaste_2024-02-12_12-14-43

RustRover (Expected) ⬇️ Snipaste_2024-02-12_12-32-57 Snipaste_2024-02-12_12-33-04

macro's name

Recognize macro name's ! as a whole. (I don't know if this is intentional)

Zed ⬇️ Snipaste_2024-02-12_12-15-24

If applicable, add mockups / screenshots to help present your vision of the feature

No response

gloridifice avatar Feb 12 '24 04:02 gloridifice

some additional examples

zed

image

VSCode

image

universalmind303 avatar Feb 21 '24 19:02 universalmind303

Is this still a global issue or is it just my zed? It seems like the syntax highlight lacks a bit, a lot of things share the same colour, especially when compared to neovim. Thank you for the amazing effort everyone.

mascanho avatar Aug 25 '24 07:08 mascanho

@iamnbutler What are your thoughts on coloring lifetimes in our themes? It would indeed be nice to make them stand out a bit more like the examples people are showing.

nathansobo avatar Jan 30 '25 17:01 nathansobo

I really, really like having type arguments/lifetimes both colorized and italicized.

Neovim

Image

Zed

Image

It would be awesome to reuse my existing tree-sitter queries to merge/override zed's queries and just tweak the colors associated with the matches. Colors that differentiate between primitive types and type identifiers would also be great.

The lack of a user-facing, fine-grained customization for syntax highlighting is less than ideal. That said, it seems like zed is close to super-customizable and the vim integration probably the best outside of vim/neovim.

roycrippen4 avatar Feb 06 '25 05:02 roycrippen4