aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/rust
diff options
context:
space:
mode:
authorKirawi2021-11-03 03:00:52 +0000
committerGitHub2021-11-03 03:00:52 +0000
commitee889aaa854d0036da3bae16252bc382e50b0df6 (patch)
tree6b084b76276c1c8f7b6af331329f89f5623f3b4a /runtime/queries/rust
parent7a0c4322eaeef7325878abe9a99adde4ad905f5e (diff)
Updated tree-sitter query scopes (#896)
* updated theme scopes variable.property -> variable.field property -> variable.field * updated theme scopes * update book and themes updated book and themes to reflect scope changes * wip * update more queries * update dark_plus.toml
Diffstat (limited to 'runtime/queries/rust')
-rw-r--r--runtime/queries/rust/highlights.scm35
1 files changed, 24 insertions, 11 deletions
diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm
index 956a5dac..539d9550 100644
--- a/runtime/queries/rust/highlights.scm
+++ b/runtime/queries/rust/highlights.scm
@@ -15,15 +15,13 @@
; Primitives
; ---
-(escape_sequence) @escape
+(escape_sequence) @constant.character.escape
(primitive_type) @type.builtin
(boolean_literal) @constant.builtin.boolean
+(integer_literal) @constant.numeric.integer
+(float_literal) @constant.numeric.float
+(char_literal) @constant.character
[
- (integer_literal)
- (float_literal)
-] @number
-[
- (char_literal)
(string_literal)
(raw_string_literal)
] @string
@@ -40,10 +38,10 @@
(enum_variant (identifier) @type.enum.variant)
(field_initializer
- (field_identifier) @property)
+ (field_identifier) @variable.other.member)
(shorthand_field_initializer
- (identifier) @variable.property)
-(shorthand_field_identifier) @variable.property
+ (identifier) @variable.other.member)
+(shorthand_field_identifier) @variable.other.member
(lifetime
"'" @label
@@ -81,9 +79,24 @@
] @punctuation.bracket)
; ---
-; Parameters
+; Variables
; ---
+(let_declaration
+ pattern: [
+ ((identifier) @variable)
+ ((tuple_pattern
+ (identifier) @variable))
+ ])
+
+; It needs to be anonymous to not conflict with `call_expression` further below.
+(_
+ value: (field_expression
+ value: (identifier)? @variable
+ field: (field_identifier) @variable.other.member))
+
+(arguments
+ (identifier) @variable.parameter)
(parameter
pattern: (identifier) @variable.parameter)
(closure_parameters
@@ -336,4 +349,4 @@
(type_identifier) @type
(identifier) @variable
-(field_identifier) @property
+(field_identifier) @variable.other.member