Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/rescript/highlights.scm')
| -rw-r--r-- | runtime/queries/rescript/highlights.scm | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/runtime/queries/rescript/highlights.scm b/runtime/queries/rescript/highlights.scm index ed41322b..51d37b87 100644 --- a/runtime/queries/rescript/highlights.scm +++ b/runtime/queries/rescript/highlights.scm @@ -10,11 +10,10 @@ [ (type_identifier) (unit_type) + (list) + (list_pattern) ] @type -(list ["list{" "}"] @type) -(list_pattern ["list{" "}"] @type) - [ (variant_identifier) (polyvar_identifier) @@ -72,14 +71,16 @@ ; single parameter with no parens (function parameter: (value_identifier) @variable.parameter) +; first-level descructuring (required for nvim-tree-sitter as it only matches direct +; children and the above patterns do not match destructuring patterns in NeoVim) +(parameter (tuple_pattern (tuple_item_pattern (value_identifier) @variable.parameter))) +(parameter (array_pattern (value_identifier) @variable.parameter)) +(parameter (record_pattern (value_identifier) @variable.parameter)) + ; Meta ;----- -[ - "@" - "@@" - (decorator_identifier) -] @keyword.directive +(decorator_identifier) @keyword.directive (extension_identifier) @keyword ("%") @keyword @@ -87,7 +88,7 @@ ; Misc ;----- -; (subscript_expression index: (string) @attribute) +(subscript_expression index: (string) @attribute) (polyvar_type_pattern "#" @constant) [ @@ -101,18 +102,21 @@ "external" "let" "module" + "mutable" "private" "rec" "type" "and" "assert" - "async" "await" "with" - "unpack" -] @keyword.storage.type + "lazy" + "constraint" +] @keyword + +((function "async" @keyword.storage)) -"mutable" @keyword.storage.modifier +(module_unpack "unpack" @keyword) [ "if" @@ -169,6 +173,7 @@ "->" "|>" ":>" + "+=" (uncurry) ] @operator |