Skip to content
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

Rust: make references be distinguishable #81

Open
zanedp opened this issue Dec 3, 2023 · 0 comments
Open

Rust: make references be distinguishable #81

zanedp opened this issue Dec 3, 2023 · 0 comments

Comments

@zanedp
Copy link
Contributor

zanedp commented Dec 3, 2023

Ideally, the color theme should make things that aren't obvious from the local syntax stand out. When editing Rust code, it's not clear from syntax when a variable is a reference, especially when using type interference or chained iterators.

I suggest that rather than have property accesses be in italic, have references be in italic.

I have no trouble telling syntax when I'm accessing a property (there's a dot!), but I don't always know if something is a reference until the compiler yells because I didn't use a reference like a reference (or vice versa).

I have found adding these to my editor.sematicTokenColorCustomizations in settings helps me out a ton when editing Rust code because it makes it obvious whether something is a reference or not: variables that are references are italics, and methods that take a reference to self (&self or &mut self) are also italicized.

"enabled": true,
"property": {
    "italic": false,
},
"*.reference": {
    "italic": true
},
"*.mutable": {
    "bold": true
},
"*.consuming": {
    "underline": true,
},

This request is probably related to #43.

Edit 2024-08-31: Updated to use italic property rather than fontStyle. Also added mutable and consuming which are helpful distinguishers when editing Rust code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant