aboutsummaryrefslogtreecommitdiffstats
path: root/queries
diff options
context:
space:
mode:
authorkiyan <yazdani.kiyan@protonmail.com>2021-11-04 20:47:26 +0100
committerStephan Seitz <stephan.seitz@fau.de>2021-11-28 00:45:02 +0100
commitcd987a44f0cacc84712ec357679a4444df7ee7ae (patch)
tree309a4df174a8aa4db5d7637c2576be14cb8d94a9 /queries
parentfeat(prisma): add ftdetect (diff)
downloadnvim-treesitter-cd987a44f0cacc84712ec357679a4444df7ee7ae.tar
nvim-treesitter-cd987a44f0cacc84712ec357679a4444df7ee7ae.tar.gz
nvim-treesitter-cd987a44f0cacc84712ec357679a4444df7ee7ae.tar.bz2
nvim-treesitter-cd987a44f0cacc84712ec357679a4444df7ee7ae.tar.lz
nvim-treesitter-cd987a44f0cacc84712ec357679a4444df7ee7ae.tar.xz
nvim-treesitter-cd987a44f0cacc84712ec357679a4444df7ee7ae.tar.zst
nvim-treesitter-cd987a44f0cacc84712ec357679a4444df7ee7ae.zip
feat(elm): add first elm highlight
Diffstat (limited to 'queries')
-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