summaryrefslogtreecommitdiff
path: root/queries/elm/highlights.scm
blob: 4d644ac63dfdaae1b4b2574a961cbdc74c5dd5c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
[(line_comment) (block_comment)] @comment

; Keywords
[
    "if"
    "then"
    "else"
    (case)
    (of)
] @conditional

[
  "let"
  "in"
  (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