Skip to content

PunkE01: In vscode, types can't be styled differently from their field name #3266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gilescope opened this issue Feb 21, 2020 · 2 comments
Closed
Labels
A-vscode vscode plugin issues

Comments

@gilescope
Copy link
Contributor

In vscode struct and enum type names have a textmate scope, but field types don't have a different textmate scope and so can't be styled differently from the default 'source.rust' textmate scope.

This level of styling fidelity is obviously essential for opening up the ability for people to roll their own rusty cyberPunk themes. (btw. mutation being underlined seems very cyberpunk)

I can see there's a mapping from TAG_TO_SCOPES here:
https://github.com/rust-analyzer/rust-analyzer/blob/04dacb994349848873f9b2576d53685630883300/editors/code/src/highlighting.ts

and digging there is a field tag:

https://github.com/rust-analyzer/rust-analyzer/blob/27587f3501168c0522e62bf14923aedbdc08a960/crates/ra_ide/src/syntax_highlighting.rs

but I can't see any sign of the entity.name.field textmate style on any fields (used or defined)? It feels like there should be enough to style fields separately from their types.

Any tips gratefully received!

@flodiebold flodiebold added the A-vscode vscode plugin issues label Feb 22, 2020
@Veetaha
Copy link
Contributor

Veetaha commented Feb 24, 2020

Thank you for the proposal! Our current code highlighting setup is quite handcrafted, so instead we would like to invest resources into the development of semantic tokens highlighting API (#3159) that should reach the stable language server protocol release in the nearest future.

@lnicola
Copy link
Member

lnicola commented Jan 22, 2021

This is now solved:

image

image

@lnicola lnicola closed this as completed Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-vscode vscode plugin issues
Projects
None yet
Development

No branches or pull requests

4 participants