EvgeniyPeshkov / syntax-highlighter

Syntax Highlighter extension for Visual Studio Code (VSCode). Based on Tree-sitter.
https://marketplace.visualstudio.com/items?itemName=evgeniypeshkov.syntax-highlighter
MIT License
210 stars 43 forks source link

[Rust] self is a keyword #7

Closed Geobert closed 5 years ago

Geobert commented 5 years ago

image Here, self is like a variable, but it's a keyword, equivalent to this in C++

Geobert commented 5 years ago
#[derive(Debug, Serialize, Deserialize)]
pub struct Token {
    pub session_token: String,
}

impl Deref for Token {
    type Target = String;

    fn deref(&self) -> &String {
        &self.session_token
    }
}
EvgeniyPeshkov commented 5 years ago

May I then highlight all occurrences of self, super and crate as keyword_operator, keyword_constant, or keyword_directive. I recommend you to choose keyword_operator or keyword_constant (=.

Geobert commented 5 years ago

I was thinking of keyword_control ^^'

EvgeniyPeshkov commented 5 years ago

Yep, keyword_control is also good. The point was, not to use keyword_directive ))).