aboutsummaryrefslogtreecommitdiff
path: root/helix-22.03-x86_64-windows/runtime/queries/rescript/highlights.scm
diff options
context:
space:
mode:
authorIndrajith K L2022-12-03 17:00:20 +0530
committerIndrajith K L2022-12-03 17:00:20 +0530
commitf5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch)
tree2764fc62da58f2ba8da7ed341643fc359873142f /helix-22.03-x86_64-windows/runtime/queries/rescript/highlights.scm
downloadcli-tools-windows-master.tar.gz
cli-tools-windows-master.tar.bz2
cli-tools-windows-master.zip
Adds most of the toolsHEADmaster
Diffstat (limited to 'helix-22.03-x86_64-windows/runtime/queries/rescript/highlights.scm')
-rw-r--r--helix-22.03-x86_64-windows/runtime/queries/rescript/highlights.scm178
1 files changed, 178 insertions, 0 deletions
diff --git a/helix-22.03-x86_64-windows/runtime/queries/rescript/highlights.scm b/helix-22.03-x86_64-windows/runtime/queries/rescript/highlights.scm
new file mode 100644
index 0000000..a9cbeb5
--- /dev/null
+++ b/helix-22.03-x86_64-windows/runtime/queries/rescript/highlights.scm
@@ -0,0 +1,178 @@
+(comment) @comment
+
+; Identifiers
+;------------
+
+; Escaped identifiers like \"+."
+((value_identifier) @function.macro
+ (#match? @function.macro "^\\.*$"))
+
+[
+ (type_identifier)
+ (unit_type)
+ "list"
+] @type
+
+[
+ (variant_identifier)
+ (polyvar_identifier)
+] @constant
+
+(property_identifier) @variable.other.member
+(module_identifier) @namespace
+
+(jsx_identifier) @tag
+(jsx_attribute (property_identifier) @variable.parameter)
+
+; Parameters
+;----------------
+
+(list_pattern (value_identifier) @variable.parameter)
+(spread_pattern (value_identifier) @variable.parameter)
+
+; String literals
+;----------------
+
+[
+ (string)
+ (template_string)
+] @string
+
+(template_substitution
+ "${" @punctuation.bracket
+ "}" @punctuation.bracket) @embedded
+
+(character) @constant.character
+(escape_sequence) @constant.character.escape
+
+; Other literals
+;---------------
+
+[
+ (true)
+ (false)
+] @constant.builtin
+
+(number) @constant.numeric
+(polyvar) @constant
+(polyvar_string) @constant
+
+; Functions
+;----------
+
+[
+ (formal_parameters (value_identifier))
+ (labeled_parameter (value_identifier))
+] @variable.parameter
+
+(function parameter: (value_identifier) @variable.parameter)
+
+; Meta
+;-----
+
+[
+ "@"
+ "@@"
+ (decorator_identifier)
+] @label
+
+(extension_identifier) @keyword
+("%") @keyword
+
+; Misc
+;-----
+
+(subscript_expression index: (string) @variable.other.member)
+(polyvar_type_pattern "#" @constant)
+
+[
+ ("include")
+ ("open")
+] @keyword
+
+[
+ "as"
+ "export"
+ "external"
+ "let"
+ "module"
+ "mutable"
+ "private"
+ "rec"
+ "type"
+ "and"
+] @keyword
+
+[
+ "if"
+ "else"
+ "switch"
+] @keyword
+
+[
+ "exception"
+ "try"
+ "catch"
+ "raise"
+] @keyword
+
+[
+ "."
+ ","
+ "|"
+] @punctuation.delimiter
+
+[
+ "++"
+ "+"
+ "+."
+ "-"
+ "-."
+ "*"
+ "*."
+ "/"
+ "/."
+ "<"
+ "<="
+ "=="
+ "==="
+ "!"
+ "!="
+ "!=="
+ ">"
+ ">="
+ "&&"
+ "||"
+ "="
+ ":="
+ "->"
+ "|>"
+ ":>"
+ (uncurry)
+] @operator
+
+[
+ "("
+ ")"
+ "{"
+ "}"
+ "["
+ "]"
+] @punctuation.bracket
+
+(polyvar_type
+ [
+ "["
+ "[>"
+ "[<"
+ "]"
+ ] @punctuation.bracket)
+
+[
+ "~"
+ "?"
+ "=>"
+ "..."
+] @punctuation
+
+(ternary_expression ["?" ":"] @operator)