Introduce storage_class highlight scope (#2731)

pull/2781/head
Anton Romanov 2 years ago committed by GitHub
parent cdeab337cd
commit 7983c71752
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -151,6 +151,7 @@ We use a similar set of scopes as
- `operator` - `or`, `in` - `operator` - `or`, `in`
- `directive` - Preprocessor directives (`#if` in C) - `directive` - Preprocessor directives (`#if` in C)
- `function` - `fn`, `func` - `function` - `fn`, `func`
- `storage` - Keywords that affect the storage of a variable, function or data structure `static`, `mut`, `const`, `ref`
- `operator` - `||`, `+=`, `>` - `operator` - `||`, `+=`, `>`

@ -1,8 +1,9 @@
(storage_class_specifier) @keyword.storage
"goto" @keyword "goto" @keyword
"register" @keyword "register" @keyword
"break" @keyword "break" @keyword
"case" @keyword "case" @keyword
"const" @keyword
"continue" @keyword "continue" @keyword
"default" @keyword "default" @keyword
"do" @keyword "do" @keyword
@ -14,7 +15,6 @@
"inline" @keyword "inline" @keyword
"return" @keyword "return" @keyword
"sizeof" @keyword "sizeof" @keyword
"static" @keyword
"struct" @keyword "struct" @keyword
"switch" @keyword "switch" @keyword
"typedef" @keyword "typedef" @keyword

@ -156,16 +156,22 @@
"macro_rules!" "macro_rules!"
"let" "let"
"ref"
"move"
"dyn"
"static"
"const"
"async" "async"
] @keyword ] @keyword
(mutable_specifier) @keyword.mut (mutable_specifier) @keyword.storage.modifier.mut
(reference_type "&" @keyword.storage.modifier.ref)
(self_parameter "&" @keyword.storage.modifier.ref)
[
"static"
"const"
"ref"
"move"
"dyn"
] @keyword.storage.modifier
; TODO: variable.mut to highlight mutable identifiers via locals.scm ; TODO: variable.mut to highlight mutable identifiers via locals.scm

Loading…
Cancel
Save