aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--queries/elm/highlights.scm88
-rw-r--r--queries/elm/injections.scm3
2 files changed, 91 insertions, 0 deletions
diff --git a/queries/elm/highlights.scm b/queries/elm/highlights.scm
new file mode 100644
index 000000000..12ce58c0d
--- /dev/null
+++ b/queries/elm/highlights.scm
@@ -0,0 +1,88 @@
+; Keywords
+[
+ "if"
+ "then"
+ "else"
+ "let"
+ "in"
+ (case)
+ (of)
+] @conditional
+
+[
+ (as)
+ (port)
+ (exposing)
+ (alias)
+ (infix)
+ (module)
+] @keyword
+
+[
+ (double_dot)
+ "|"
+] @punctuation.special
+[
+ ","
+ (dot)
+] @punctuation.delimiter
+
+[
+ "("
+ ")"
+ "{"
+ "}"
+] @punctuation.bracket
+
+(type_annotation(lower_case_identifier) @function)
+(port_annotation(lower_case_identifier) @function)
+(function_declaration_left(lower_case_identifier) @function)
+(function_call_expr target:
+ (value_expr) @function)
+
+(value_qid (upper_case_identifier) @constructor)
+(value_qid ((dot) (lower_case_identifier) @field))
+(field_access_expr ((dot) (lower_case_identifier) @field))
+
+(lower_pattern) @parameter
+(record_base_identifier) @method
+
+[
+ (backslash)
+ (underscore)
+] @function
+
+[
+ (operator_identifier)
+ (eq)
+ (colon)
+ (arrow)
+] @operator
+
+(import) @include
+
+(number_constant_expr) @number
+
+(type) @keyword
+
+(module_declaration(upper_case_qid(upper_case_identifier)) @constructor)
+(type_declaration(upper_case_identifier) @constructor)
+(type_ref) @type
+(type_alias_declaration name: (upper_case_identifier) @type)
+(field_type name:
+ (lower_case_identifier) @property)
+
+(union_variant(upper_case_identifier) @symbol)
+(union_pattern) @symbol
+(value_expr(upper_case_qid(upper_case_identifier)) @symbol)
+
+; strings
+(string_escape) @string
+(open_quote) @string
+(close_quote) @string
+(regular_string_part) @string
+
+[
+ (open_char)
+ (close_char)
+] @character
diff --git a/queries/elm/injections.scm b/queries/elm/injections.scm
new file mode 100644
index 000000000..6395776e1
--- /dev/null
+++ b/queries/elm/injections.scm
@@ -0,0 +1,3 @@
+[(line_comment) (block_comment)] @comment
+
+(glsl_content) @glsl