mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(elm): add first elm highlight
This commit is contained in:
parent
5e388a40bc
commit
cd987a44f0
2 changed files with 91 additions and 0 deletions
88
queries/elm/highlights.scm
Normal file
88
queries/elm/highlights.scm
Normal file
|
|
@ -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
|
||||
3
queries/elm/injections.scm
Normal file
3
queries/elm/injections.scm
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[(line_comment) (block_comment)] @comment
|
||||
|
||||
(glsl_content) @glsl
|
||||
Loading…
Add table
Add a link
Reference in a new issue