Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/slint/highlights.scm')
| -rw-r--r-- | runtime/queries/slint/highlights.scm | 83 |
1 files changed, 64 insertions, 19 deletions
diff --git a/runtime/queries/slint/highlights.scm b/runtime/queries/slint/highlights.scm index 9b1337233..7ea1f55b8 100644 --- a/runtime/queries/slint/highlights.scm +++ b/runtime/queries/slint/highlights.scm @@ -1,4 +1,4 @@ -(comment) @comment +[(line_comment) (block_comment)] @comment ; Different types: (string_value) @string @@ -70,6 +70,9 @@ (function_definition name: (_) @function) +(function_declaration + name: (_) @function) + (struct_definition name: (_) @type) @@ -129,20 +132,18 @@ (binding_alias name: (simple_identifier) @variable) -(binding - name: (simple_identifier) @variable) - -(struct_block - (simple_identifier) @variable.other.member) +(struct_field_definition + name: (simple_identifier) @variable.other.member) -(anon_struct_block - (simple_identifier) @variable.other.member) +(anon_struct_assignment + member: (simple_identifier) @variable.other.member) (property_assignment property: (simple_identifier) @variable) -(states_definition - name: (simple_identifier) @variable) +(state_definition + name: (simple_identifier) @variable + "when" @keyword) (callback name: (simple_identifier) @variable) @@ -161,6 +162,7 @@ (linear_gradient_identifier) (radial_gradient_identifier) (radial_gradient_kind) + (conic_gradient_identifier) ] @attribute (image_call @@ -169,10 +171,29 @@ (tr "@tr" @attribute) +(rust_attr + "@rust-attr" @attribute) + +(keys + "@keys" @attribute) + +(markdown + "@markdown" @attribute) + +(keys + (simple_identifier) @constant) + +(keys + "+" @operator) + ; Keywords (animate_option_identifier) @keyword -(export) @keyword.control.import +(export_statement + "export" @keyword.control.import) + +(exported_definition + "export" @keyword.control.import) (if_statement "if" @keyword.control.conditional) @@ -196,10 +217,29 @@ "callback" @keyword.function) (component_definition + "component" @keyword.storage.type) + +(component_modifier + "inherits" @keyword.storage.type) + +(uses_clause + "uses" @keyword.storage.type) + +(implements_clause + "implements" @keyword.storage.type) + +(used_interface + "from" @keyword.control.import + source: (_) @variable) + +(changed_event + "changed" @keyword) + +(gradient_call [ - "component" - "inherits" - ] @keyword.storage.type) + "at" + "from" + ] @keyword) (enum_definition "enum" @keyword.storage.type) @@ -213,10 +253,18 @@ (function_definition "function" @keyword.function) +(function_declaration + "function" @keyword.function) + +(let_statement + "let" @keyword.storage.type + name: (_) @variable + "=" @operator) + (global_definition "global" @keyword.storage.type) -(imperative_block +(return_statement "return" @keyword.control.return) (import_statement @@ -232,10 +280,7 @@ "property" @keyword.storage.type) (states_definition - [ - "states" - "when" - ] @keyword) + "states" @keyword) (struct_definition "struct" @keyword.storage.type) |