on master help sign in
Updated tree-sitter query scopes (#896)
ee889aaKirawi
book/src/themes.md+6−4
@@ -103,8 +103,6 @@ We use a similar set of scopes as
103[SublimeText](https://www.sublimetext.com/docs/scope_naming.html). See also
103[SublimeText](https://www.sublimetext.com/docs/scope_naming.html). See also
104[TextMate](https://macromates.com/manual/en/language_grammars) scopes.
104[TextMate](https://macromates.com/manual/en/language_grammars) scopes.
105
105
106−- `escape` (TODO: rename to (constant).character.escape)
107−
108- `type` - Types
106- `type` - Types
109 - `builtin` - Primitive types provided by the language (`int`, `usize`)
107 - `builtin` - Primitive types provided by the language (`int`, `usize`)
110
108
@@ -112,8 +110,11 @@ We use a similar set of scopes as
112 - `builtin` Special constants provided by the language (`true`, `false`, `nil` etc)
110 - `builtin` Special constants provided by the language (`true`, `false`, `nil` etc)
113 - `boolean`
111 - `boolean`
114 - `character`
112 - `character`
113+ - `escape`
114+ - `numeric` (numbers)
115+ - `integer`
116+ - `float`
115
117
116−- `number` (TODO: rename to constant.number/.numeric.{integer, float, complex})
117- `string` (TODO: string.quoted.{single, double}, string.raw/.unquoted)?
118- `string` (TODO: string.quoted.{single, double}, string.raw/.unquoted)?
118 - `regexp` - Regular expressions
119 - `regexp` - Regular expressions
119 - `special`
120 - `special`
@@ -129,7 +130,8 @@ We use a similar set of scopes as
129- `variable` - Variables
130- `variable` - Variables
130 - `builtin` - Reserved language variables (`self`, `this`, `super`, etc)
131 - `builtin` - Reserved language variables (`self`, `this`, `super`, etc)
131 - `parameter` - Function parameters
132 - `parameter` - Function parameters
132− - `property`
133+ - `other`
134+ - `member` - Fields of composite data types (e.g. structs, unions)
133 - `function` (TODO: ?)
135 - `function` (TODO: ?)
134
136
135- `label`
137- `label`
helix-core/src/lib.rs+1
@@ -35,6 +35,7 @@ pub fn find_first_non_whitespace_char(line: RopeSlice) -> Option<usize> {
35 line.chars().position(|ch| !ch.is_whitespace())
35 line.chars().position(|ch| !ch.is_whitespace())
36}
36}
37
37
38+/// Find `.git` root.
38pub fn find_root(root: Option<&str>) -> Option<std::path::PathBuf> {
39pub fn find_root(root: Option<&str>) -> Option<std::path::PathBuf> {
39 let current_dir = std::env::current_dir().expect("unable to determine current directory");
40 let current_dir = std::env::current_dir().expect("unable to determine current directory");
40
41
runtime/queries/bash/highlights.scm+2−2
@@ -7,7 +7,7 @@
7
7
8(command_name) @function
8(command_name) @function
9
9
10−(variable_name) @property
10+(variable_name) @variable.other.member
11
11
12[
12[
13 "case"
13 "case"
@@ -31,7 +31,7 @@
31
31
32(function_definition name: (word) @function)
32(function_definition name: (word) @function)
33
33
34−(file_descriptor) @number
34+(file_descriptor) @constant.numeric.integer
35
35
36[
36[
37 (command_substitution)
37 (command_substitution)
runtime/queries/c-sharp/highlights.scm+5−5
@@ -20,16 +20,16 @@
20] @type.builtin
20] @type.builtin
21
21
22;; Enum
22;; Enum
23−(enum_member_declaration (identifier) @variable.property)
23+(enum_member_declaration (identifier) @variable.other.member)
24
24
25;; Literals
25;; Literals
26[
26[
27 (real_literal)
27 (real_literal)
28 (integer_literal)
28 (integer_literal)
29−] @number
29+] @constant.numeric.integer
30
30
31+(character_literal) @constant.character
31[
32[
32− (character_literal)
33 (string_literal)
33 (string_literal)
34 (verbatim_string_literal)
34 (verbatim_string_literal)
35 (interpolated_string_text)
35 (interpolated_string_text)
@@ -40,8 +40,8 @@
40 "$@\""
40 "$@\""
41 ] @string
41 ] @string
42
42
43+(boolean_literal) @constant.builtin.boolean
43[
44[
44− (boolean_literal)
45 (null_literal)
45 (null_literal)
46 (void_keyword)
46 (void_keyword)
47] @constant.builtin
47] @constant.builtin
@@ -98,7 +98,7 @@
98;; Keywords
98;; Keywords
99(modifier) @keyword
99(modifier) @keyword
100(this_expression) @keyword
100(this_expression) @keyword
101−(escape_sequence) @keyword
101+(escape_sequence) @constant.character.escape
102
102
103[
103[
104 "as"
104 "as"
runtime/queries/c/highlights.scm+3−3
@@ -60,8 +60,8 @@
60(system_lib_string) @string
60(system_lib_string) @string
61
61
62(null) @constant
62(null) @constant
63−(number_literal) @number
63+(number_literal) @constant.numeric.integer
64−(char_literal) @string
64+(char_literal) @constant.character
65
65
66(call_expression
66(call_expression
67 function: (identifier) @function)
67 function: (identifier) @function)
@@ -73,7 +73,7 @@
73(preproc_function_def
73(preproc_function_def
74 name: (identifier) @function.special)
74 name: (identifier) @function.special)
75
75
76−(field_identifier) @property
76+(field_identifier) @variable.other.member
77(statement_identifier) @label
77(statement_identifier) @label
78(type_identifier) @type
78(type_identifier) @type
79(primitive_type) @type
79(primitive_type) @type
runtime/queries/css/highlights.scm+7−7
@@ -26,11 +26,11 @@
26(pseudo_element_selector (tag_name) @attribute)
26(pseudo_element_selector (tag_name) @attribute)
27(pseudo_class_selector (class_name) @attribute)
27(pseudo_class_selector (class_name) @attribute)
28
28
29−(class_name) @property
29+(class_name) @variable.other.member
30−(id_name) @property
30+(id_name) @variable.other.member
31−(namespace_name) @property
31+(namespace_name) @variable.other.member
32−(property_name) @property
32+(property_name) @variable.other.member
33−(feature_name) @property
33+(feature_name) @variable.other.member
34
34
35(attribute_name) @attribute
35(attribute_name) @attribute
36
36
@@ -55,8 +55,8 @@
55(string_value) @string
55(string_value) @string
56(color_value) @string.special
56(color_value) @string.special
57
57
58−(integer_value) @number
58+(integer_value) @constant.numeric.integer
59−(float_value) @number
59+(float_value) @constant.numeric.float
60(unit) @type
60(unit) @type
61
61
62"#" @punctuation.delimiter
62"#" @punctuation.delimiter
runtime/queries/elixir/highlights.scm+8−11
@@ -39,13 +39,13 @@
39
39
40; * module attribute
40; * module attribute
41(unary_operator
41(unary_operator
42− operator: "@" @variable.property
42+ operator: "@" @variable.other.member
43 operand: [
43 operand: [
44− (identifier) @variable.property
44+ (identifier) @variable.other.member
45 (call
45 (call
46− target: (identifier) @variable.property)
46+ target: (identifier) @variable.other.member)
47− (boolean) @variable.property
47+ (boolean) @variable.other.member
48− (nil) @variable.property
48+ (nil) @variable.other.member
49 ])
49 ])
50
50
51; * capture operator
51; * capture operator
@@ -79,11 +79,8 @@
79(nil) @constant.builtin
79(nil) @constant.builtin
80
80
81(boolean) @constant.builtin.boolean
81(boolean) @constant.builtin.boolean
82−
82+(integer) @constant.numeric.integer
83−[
83+(float) @constant.numeric.float
84− (integer)
85− (float)
86−] @number
87
84
88(alias) @type
85(alias) @type
89
86
@@ -97,7 +94,7 @@
97
94
98(interpolation "#{" @punctuation.special "}" @punctuation.special) @embedded
95(interpolation "#{" @punctuation.special "}" @punctuation.special) @embedded
99
96
100−(escape_sequence) @escape
97+(escape_sequence) @constant.character.escape
101
98
102[
99[
103 (atom)
100 (atom)
runtime/queries/go/highlights.scm+3−3
@@ -25,7 +25,7 @@
25(variadic_parameter_declaration (identifier) @variable.parameter)
25(variadic_parameter_declaration (identifier) @variable.parameter)
26
26
27(type_identifier) @type
27(type_identifier) @type
28−(field_identifier) @property
28+(field_identifier) @variable.other.member
29(identifier) @variable
29(identifier) @variable
30(package_identifier) @variable
30(package_identifier) @variable
31
31
@@ -130,13 +130,13 @@
130 (rune_literal)
130 (rune_literal)
131] @string
131] @string
132
132
133−(escape_sequence) @escape
133+(escape_sequence) @constant.character.escape
134
134
135[
135[
136 (int_literal)
136 (int_literal)
137 (float_literal)
137 (float_literal)
138 (imaginary_literal)
138 (imaginary_literal)
139−] @number
139+] @constant.numeric.integer
140
140
141[
141[
142 (true)
142 (true)
runtime/queries/haskell/highlights.scm+3−3
@@ -13,9 +13,9 @@
13(constraint class: (class_name (type)) @class)
13(constraint class: (class_name (type)) @class)
14(class (class_head class: (class_name (type)) @class))
14(class (class_head class: (class_name (type)) @class))
15(instance (instance_head class: (class_name (type)) @class))
15(instance (instance_head class: (class_name (type)) @class))
16−(integer) @number
16+(integer) @constant.numeric.integer
17−(exp_literal (float)) @number
17+(exp_literal (float)) @constant.numeric.float
18−(char) @literal
18+(char) @constant.character
19(con_unit) @literal
19(con_unit) @literal
20(con_list) @literal
20(con_list) @literal
21(tycon_arrow) @operator
21(tycon_arrow) @operator
runtime/queries/java/highlights.scm+6−5
@@ -59,14 +59,15 @@
59 (hex_integer_literal)
59 (hex_integer_literal)
60 (decimal_integer_literal)
60 (decimal_integer_literal)
61 (octal_integer_literal)
61 (octal_integer_literal)
62+] @constant.numeric.integer
63+
64+[
62 (decimal_floating_point_literal)
65 (decimal_floating_point_literal)
63 (hex_floating_point_literal)
66 (hex_floating_point_literal)
64−] @number
67+] @constant.numeric.float
65
68
66−[
67− (character_literal)
69+(character_literal) @constant.character
68− (string_literal)
70+(string_literal) @string
69−] @string
70
71
71[
72[
72 (true)
73 (true)
runtime/queries/javascript/highlights.scm+2−2
@@ -65,7 +65,7 @@
65; Properties
65; Properties
66;-----------
66;-----------
67
67
68−(property_identifier) @property
68+(property_identifier) @variable.other.member
69
69
70; Literals
70; Literals
71;---------
71;---------
@@ -88,7 +88,7 @@
88] @string
88] @string
89
89
90(regex) @string.regexp
90(regex) @string.regexp
91−(number) @number
91+(number) @constant.numeric.integer
92
92
93; Tokens
93; Tokens
94;-------
94;-------
runtime/queries/json/highlights.scm+15−4
@@ -1,9 +1,20 @@
1+[
2+ (true)
3+ (false)
4+] @constant.builtin.boolean
5+(null) @constant.builtin
6+(number) @constant.numeric
1(pair
7(pair
2 key: (_) @keyword)
8 key: (_) @keyword)
3
9
4(string) @string
10(string) @string
11+(escape_sequence) @constant.character.escape
12+(ERROR) @error
5
13
6−(object
14+"," @punctuation.delimiter
15+[
16+ "["
17+ "]"
7− "{" @escape
18+ "{"
8− (_)
9− "}" @escape)
19+ "}"
20+] @punctuation.bracket
runtime/queries/julia/highlights.scm+6−6
@@ -15,7 +15,7 @@
15
15
16(field_expression
16(field_expression
17 (identifier)
17 (identifier)
18− (identifier) @field .)
18+ (identifier) @variable.other.member .)
19
19
20(function_definition
20(function_definition
21 name: (identifier) @function)
21 name: (identifier) @function)
@@ -80,14 +80,14 @@
80(struct_definition
80(struct_definition
81 name: (identifier) @type)
81 name: (identifier) @type)
82
82
83−(number) @number
83+(number) @constant.numeric.integer
84(range_expression
84(range_expression
85− (identifier) @number
85+ (identifier) @constant.numeric.integer
86− (eq? @number "end"))
86+ (eq? @constant.numeric.integer "end"))
87(range_expression
87(range_expression
88 (_
88 (_
89− (identifier) @number
89+ (identifier) @constant.numeric.integer
90− (eq? @number "end")))
90+ (eq? @constant.numeric.integer "end")))
91(coefficient_expression
91(coefficient_expression
92 (number)
92 (number)
93 (identifier) @constant.builtin)
93 (identifier) @constant.builtin)
runtime/queries/ledger/highlights.scm+2−2
@@ -7,9 +7,9 @@
7 (date)
7 (date)
8 (interval)
8 (interval)
9 (quantity)
9 (quantity)
10−] @number
10+] @constant.numeric.integer
11
11
12−((account) @field)
12+((account) @variable.other.member)
13((commodity) @text.literal)
13((commodity) @text.literal)
14
14
15"include" @include
15"include" @include
runtime/queries/lua/highlights.scm+3−3
@@ -150,14 +150,14 @@
150(table ["{" "}"] @constructor)
150(table ["{" "}"] @constructor)
151(comment) @comment
151(comment) @comment
152(string) @string
152(string) @string
153−(number) @number
153+(number) @constant.numeric.integer
154(label_statement) @label
154(label_statement) @label
155; A bit of a tricky one, this will only match field names
155; A bit of a tricky one, this will only match field names
156−(field . (identifier) @property (_))
156+(field . (identifier) @variable.other.member (_))
157(shebang) @comment
157(shebang) @comment
158
158
159;; Property
159;; Property
160−(property_identifier) @property
160+(property_identifier) @variable.other.member
161
161
162;; Variable
162;; Variable
163(identifier) @variable
163(identifier) @variable
runtime/queries/nix/highlights.scm+5−7
@@ -33,16 +33,14 @@
33
33
34(uri) @string.special.uri
34(uri) @string.special.uri
35
35
36−[
36+(integer) @constant.numeric.integer
37− (integer)
37+(float) @constant.numeric.float
38− (float)
39−] @number
40
38
41(interpolation
39(interpolation
42 "${" @punctuation.special
40 "${" @punctuation.special
43 "}" @punctuation.special) @embedded
41 "}" @punctuation.special) @embedded
44
42
45−(escape_sequence) @escape
43+(escape_sequence) @constant.character.escape
46
44
47(function
45(function
48 universal: (identifier) @variable.parameter
46 universal: (identifier) @variable.parameter
@@ -66,8 +64,8 @@
66(binary
64(binary
67 operator: _ @operator)
65 operator: _ @operator)
68
66
69−(attr_identifier) @property
67+(attr_identifier) @variable.other.member
70−(inherit attrs: (attrs_inherited (identifier) @property) )
68+(inherit attrs: (attrs_inherited (identifier) @variable.other.member) )
71
69
72[
70[
73 ";"
71 ";"
runtime/queries/ocaml/highlights.scm+4−4
@@ -51,14 +51,14 @@
51; Properties
51; Properties
52;-----------
52;-----------
53
53
54−[(label_name) (field_name) (instance_variable_name)] @property
54+[(label_name) (field_name) (instance_variable_name)] @variable.other.member
55
55
56; Constants
56; Constants
57;----------
57;----------
58
58
59[(boolean) (unit)] @constant
59[(boolean) (unit)] @constant
60
60
61−[(number) (signed_number)] @number
61+[(number) (signed_number)] @constant.numeric.integer
62
62
63(character) @constant.character
63(character) @constant.character
64
64
@@ -66,7 +66,7 @@
66
66
67(quoted_string "{" @string "}" @string) @string
67(quoted_string "{" @string "}" @string) @string
68
68
69−(escape_sequence) @string.escape
69+(escape_sequence) @constant.character.escape
70
70
71[
71[
72 (conversion_specification)
72 (conversion_specification)
@@ -145,7 +145,7 @@
145; Attributes
145; Attributes
146;-----------
146;-----------
147
147
148−(attribute_id) @property
148+(attribute_id) @variable.other.member
149
149
150; Comments
150; Comments
151;---------
151;---------
runtime/queries/php/highlights.scm+6−6
@@ -30,12 +30,12 @@
30; Member
30; Member
31
31
32(property_element
32(property_element
33− (variable_name) @property)
33+ (variable_name) @variable.other.member)
34
34
35(member_access_expression
35(member_access_expression
36− name: (variable_name (name)) @property)
36+ name: (variable_name (name)) @variable.other.member)
37(member_access_expression
37(member_access_expression
38− name: (name) @property)
38+ name: (name) @variable.other.member)
39
39
40; Variables
40; Variables
41
41
@@ -56,10 +56,10 @@
56
56
57(string) @string
57(string) @string
58(heredoc) @string
58(heredoc) @string
59−(boolean) @constant.builtin
59+(boolean) @constant.builtin.boolean
60(null) @constant.builtin
60(null) @constant.builtin
61−(integer) @number
61+(integer) @constant.numeric.integer
62−(float) @number
62+(float) @constant.numeric.float
63(comment) @comment
63(comment) @comment
64
64
65"$" @operator
65"$" @operator
runtime/queries/protobuf/highlights.scm+4−6
@@ -34,16 +34,14 @@
34[
34[
35 (fieldName)
35 (fieldName)
36 (optionName)
36 (optionName)
37−] @property
37+] @variable.other.member
38(enumVariantName) @type.enum.variant
38(enumVariantName) @type.enum.variant
39
39
40(fullIdent) @namespace
40(fullIdent) @namespace
41
41
42−[
42+(intLit) @constant.numeric.integer
43− (intLit)
44− (floatLit)
43+(floatLit) @constant.numeric.float
45−] @number
46−(boolLit) @constant.builtin
44+(boolLit) @constant.builtin.boolean
47(strLit) @string
45(strLit) @string
48
46
49(constant) @constant
47(constant) @constant
runtime/queries/python/highlights.scm+4−7
@@ -29,7 +29,7 @@
29 name: (identifier) @function)
29 name: (identifier) @function)
30
30
31(identifier) @variable
31(identifier) @variable
32−(attribute attribute: (identifier) @property)
32+(attribute attribute: (identifier) @variable.other.member)
33(type (identifier) @type)
33(type (identifier) @type)
34
34
35; Literals
35; Literals
@@ -40,14 +40,11 @@
40 (false)
40 (false)
41] @constant.builtin
41] @constant.builtin
42
42
43−[
43+(integer) @constant.numeric.integer
44− (integer)
44+(float) @constant.numeric.float
45− (float)
46−] @number
47−
48(comment) @comment
45(comment) @comment
49(string) @string
46(string) @string
50−(escape_sequence) @escape
47+(escape_sequence) @constant.character.escape
51
48
52(interpolation
49(interpolation
53 "{" @punctuation.special
50 "{" @punctuation.special
runtime/queries/ruby/highlights.scm+3−3
@@ -55,7 +55,7 @@
55[
55[
56 (class_variable)
56 (class_variable)
57 (instance_variable)
57 (instance_variable)
58−] @property
58+] @variable.other.member
59
59
60((identifier) @constant.builtin
60((identifier) @constant.builtin
61 (#match? @constant.builtin "^__(FILE|LINE|ENCODING)__$"))
61 (#match? @constant.builtin "^__(FILE|LINE|ENCODING)__$"))
@@ -101,12 +101,12 @@
101] @string.special.symbol
101] @string.special.symbol
102
102
103(regex) @string.regexp
103(regex) @string.regexp
104−(escape_sequence) @escape
104+(escape_sequence) @constant.character.escape
105
105
106[
106[
107 (integer)
107 (integer)
108 (float)
108 (float)
109−] @number
109+] @constant.numeric.integer
110
110
111[
111[
112 (nil)
112 (nil)
runtime/queries/rust/highlights.scm+24−11
@@ -15,15 +15,13 @@
15; Primitives
15; Primitives
16; ---
16; ---
17
17
18−(escape_sequence) @escape
18+(escape_sequence) @constant.character.escape
19(primitive_type) @type.builtin
19(primitive_type) @type.builtin
20(boolean_literal) @constant.builtin.boolean
20(boolean_literal) @constant.builtin.boolean
21+(integer_literal) @constant.numeric.integer
22+(float_literal) @constant.numeric.float
23+(char_literal) @constant.character
21[
24[
22− (integer_literal)
23− (float_literal)
24−] @number
25−[
26− (char_literal)
27 (string_literal)
25 (string_literal)
28 (raw_string_literal)
26 (raw_string_literal)
29] @string
27] @string
@@ -40,10 +38,10 @@
40(enum_variant (identifier) @type.enum.variant)
38(enum_variant (identifier) @type.enum.variant)
41
39
42(field_initializer
40(field_initializer
43− (field_identifier) @property)
41+ (field_identifier) @variable.other.member)
44(shorthand_field_initializer
42(shorthand_field_initializer
45− (identifier) @variable.property)
43+ (identifier) @variable.other.member)
46−(shorthand_field_identifier) @variable.property
44+(shorthand_field_identifier) @variable.other.member
47
45
48(lifetime
46(lifetime
49 "'" @label
47 "'" @label
@@ -81,9 +79,24 @@
81 ] @punctuation.bracket)
79 ] @punctuation.bracket)
82
80
83; ---
81; ---
84−; Parameters
82+; Variables
85; ---
83; ---
86
84
85+(let_declaration
86+ pattern: [
87+ ((identifier) @variable)
88+ ((tuple_pattern
89+ (identifier) @variable))
90+ ])
91+
92+; It needs to be anonymous to not conflict with `call_expression` further below.
93+(_
94+ value: (field_expression
95+ value: (identifier)? @variable
96+ field: (field_identifier) @variable.other.member))
97+
98+(arguments
99+ (identifier) @variable.parameter)
87(parameter
100(parameter
88 pattern: (identifier) @variable.parameter)
101 pattern: (identifier) @variable.parameter)
89(closure_parameters
102(closure_parameters
@@ -336,4 +349,4 @@
336
349
337(type_identifier) @type
350(type_identifier) @type
338(identifier) @variable
351(identifier) @variable
339−(field_identifier) @property
352+(field_identifier) @variable.other.member
runtime/queries/svelte/highlights.scm+1−1
@@ -29,7 +29,7 @@
29 (#match? @_attr "^(href|src)$"))
29 (#match? @_attr "^(href|src)$"))
30
30
31(tag_name) @tag
31(tag_name) @tag
32−(attribute_name) @property
32+(attribute_name) @variable.other.member
33(erroneous_end_tag_name) @error
33(erroneous_end_tag_name) @error
34(comment) @comment
34(comment) @comment
35
35
runtime/queries/toml/highlights.scm+4−4
@@ -1,17 +1,17 @@
1; Properties
1; Properties
2;-----------
2;-----------
3
3
4−(bare_key) @property
4+(bare_key) @variable.other.member
5(quoted_key) @string
5(quoted_key) @string
6
6
7; Literals
7; Literals
8;---------
8;---------
9
9
10−(boolean) @constant.builtin
10+(boolean) @constant.builtin.boolean
11(comment) @comment
11(comment) @comment
12(string) @string
12(string) @string
13−(integer) @number
13+(integer) @constant.numeric.integer
14−(float) @number
14+(float) @constant.numeric.float
15(offset_date_time) @string.special
15(offset_date_time) @string.special
16(local_date_time) @string.special
16(local_date_time) @string.special
17(local_date) @string.special
17(local_date) @string.special
runtime/queries/tsq/highlights.scm+2−2
@@ -35,12 +35,12 @@
35
35
36(comment) @comment
36(comment) @comment
37
37
38−(field_name) @property
38+(field_name) @variable.other.member
39
39
40(capture) @label
40(capture) @label
41
41
42(predicate_name) @function
42(predicate_name) @function
43
43
44−(escape_sequence) @escape
44+(escape_sequence) @constant.character.escape
45
45
46(node_name) @variable
46(node_name) @variable
runtime/queries/yaml/highlights.scm+5−5
@@ -1,12 +1,12 @@
1−(block_mapping_pair key: (_) @property)
1+(block_mapping_pair key: (_) @variable.other.member)
2−(flow_mapping (_ key: (_) @property))
2+(flow_mapping (_ key: (_) @variable.other.member))
3(boolean_scalar) @constant.builtin.boolean
3(boolean_scalar) @constant.builtin.boolean
4(null_scalar) @constant.builtin
4(null_scalar) @constant.builtin
5(double_quote_scalar) @string
5(double_quote_scalar) @string
6(single_quote_scalar) @string
6(single_quote_scalar) @string
7−(escape_sequence) @string.escape
7+(escape_sequence) @constant.character.escape
8−(integer_scalar) @number
8+(integer_scalar) @constant.numeric.integer
9−(float_scalar) @number
9+(float_scalar) @constant.numeric.float
10(comment) @comment
10(comment) @comment
11(anchor_name) @type
11(anchor_name) @type
12(alias_name) @type
12(alias_name) @type
runtime/queries/zig/highlights.scm+4−4
@@ -14,7 +14,7 @@ parameter: (IDENTIFIER) @variable.parameter
14[
14[
15 field_member: (IDENTIFIER)
15 field_member: (IDENTIFIER)
16 field_access: (IDENTIFIER)
16 field_access: (IDENTIFIER)
17−] @variable.property
17+] @variable.other.member
18
18
19;; assume TitleCase is a type
19;; assume TitleCase is a type
20(
20(
@@ -75,9 +75,9 @@ field_constant: (IDENTIFIER) @constant
75((BUILTINIDENTIFIER) @keyword.control.import
75((BUILTINIDENTIFIER) @keyword.control.import
76 (#any-of? @keyword.control.import "@import" "@cImport"))
76 (#any-of? @keyword.control.import "@import" "@cImport"))
77
77
78−(INTEGER) @number
78+(INTEGER) @constant.numeric.integer
79
79
80−(FLOAT) @number
80+(FLOAT) @constant.numeric.float
81
81
82[
82[
83 (LINESTRING)
83 (LINESTRING)
@@ -85,7 +85,7 @@ field_constant: (IDENTIFIER) @constant
85] @string
85] @string
86
86
87(CHAR_LITERAL) @constant.character
87(CHAR_LITERAL) @constant.character
88−(EscapeSequence) @escape
88+(EscapeSequence) @constant.character.escape
89(FormatSequence) @string.special
89(FormatSequence) @string.special
90
90
91[
91[
runtime/themes/base16_default_dark.toml+3−3
@@ -16,14 +16,14 @@
16"operator" = "base05"
16"operator" = "base05"
17"ui.text.focus" = { fg = "base05" }
17"ui.text.focus" = { fg = "base05" }
18"variable" = "base08"
18"variable" = "base08"
19−"number" = "base09"
19+"constant.numeric" = "base09"
20"constant" = "base09"
20"constant" = "base09"
21"attributes" = "base09"
21"attributes" = "base09"
22"type" = "base0A"
22"type" = "base0A"
23"ui.cursor.match" = { fg = "base0A", modifiers = ["underlined"] }
23"ui.cursor.match" = { fg = "base0A", modifiers = ["underlined"] }
24"strings" = "base0B"
24"strings" = "base0B"
25−"property" = "base0B"
25+"variable.other.member" = "base0B"
26−"escape" = "base0C"
26+"constant.character.escape" = "base0C"
27"function" = "base0D"
27"function" = "base0D"
28"constructor" = "base0D"
28"constructor" = "base0D"
29"special" = "base0D"
29"special" = "base0D"
runtime/themes/bogster.toml+3−3
@@ -8,7 +8,7 @@
8"punctuation.delimiter" = "#dc7759"
8"punctuation.delimiter" = "#dc7759"
9"operator" = { fg = "#dc7759", modifiers = ["bold"] }
9"operator" = { fg = "#dc7759", modifiers = ["bold"] }
10"special" = "#7fdc59"
10"special" = "#7fdc59"
11−"property" = "#c6b8ad"
11+"variable.other.member" = "#c6b8ad"
12"variable" = "#c6b8ad"
12"variable" = "#c6b8ad"
13"variable.parameter" = "#c6b8ad"
13"variable.parameter" = "#c6b8ad"
14"type" = "#dc597f"
14"type" = "#dc597f"
@@ -22,8 +22,8 @@
22"constant" = "#59dcb7"
22"constant" = "#59dcb7"
23"constant.builtin" = "#59dcb7"
23"constant.builtin" = "#59dcb7"
24"string" = "#59dcb7"
24"string" = "#59dcb7"
25−"number" = "#59c0dc"
25+"constant.numeric" = "#59c0dc"
26−"escape" = { fg = "#7fdc59", modifiers = ["bold"] }
26+"constant.character.escape" = { fg = "#7fdc59", modifiers = ["bold"] }
27"label" = "#59c0dc"
27"label" = "#59c0dc"
28
28
29"module" = "#d32c5d"
29"module" = "#d32c5d"
runtime/themes/dark_plus.toml+35−18
@@ -7,7 +7,7 @@
7"type.builtin" = { fg = "type" }
7"type.builtin" = { fg = "type" }
8"type.enum.variant" = { fg = "constant" }
8"type.enum.variant" = { fg = "constant" }
9"constructor" = { fg = "constant" }
9"constructor" = { fg = "constant" }
10−"property" = { fg = "variable" }
10+"variable.other.member" = { fg = "variable" }
11
11
12"keyword" = { fg = "keyword" }
12"keyword" = { fg = "keyword" }
13"keyword.directive" = { fg = "keyword" }
13"keyword.directive" = { fg = "keyword" }
@@ -31,47 +31,64 @@
31"function.macro" = { fg = "keyword" }
31"function.macro" = { fg = "keyword" }
32"attribute" = { fg = "fn_declaration" }
32"attribute" = { fg = "fn_declaration" }
33
33
34−"comment" = { fg = "#6A9955" }
34+"comment" = { fg = "dark_green" }
35
35
36−"string" = { fg = "#ce9178" }
36+"string" = { fg = "orange" }
37+"constant.character" = { fg = "orange" }
37−"string.regexp" = { fg = "regex" }
38+"string.regexp" = { fg = "gold" }
38−"number" = { fg = "#b5cea8" }
39+"constant.numeric" = { fg = "pale_green" }
39−"escape" = { fg = "#d7ba7d" }
40+"constant.character.escape" = { fg = "gold" }
40
41
41−"ui.background" = { fg = "#d4d4d4", bg = "#1e1e1e" }
42+"ui.background" = { fg = "light_gray", bg = "dark_gray2" }
42
43
43"ui.window" = { bg = "widget" }
44"ui.window" = { bg = "widget" }
44"ui.popup" = { bg = "widget" }
45"ui.popup" = { bg = "widget" }
45"ui.help" = { bg = "widget" }
46"ui.help" = { bg = "widget" }
46"ui.menu.selected" = { bg = "widget" }
47"ui.menu.selected" = { bg = "widget" }
47
48
49+# TODO: Alternate bg colour for `ui.cursor.match` and `ui.selection`.
48"ui.cursor" = { fg = "cursor", modifiers = ["reversed"] }
50"ui.cursor" = { fg = "cursor", modifiers = ["reversed"] }
49"ui.cursor.primary" = { fg = "cursor", modifiers = ["reversed"] }
51"ui.cursor.primary" = { fg = "cursor", modifiers = ["reversed"] }
50"ui.cursor.match" = { bg = "#3a3d41", modifiers = ["underlined"] }
52"ui.cursor.match" = { bg = "#3a3d41", modifiers = ["underlined"] }
51
53
52"ui.selection" = { bg = "#3a3d41" }
54"ui.selection" = { bg = "#3a3d41" }
53−"ui.selection.primary" = { bg = "#264f78" }
55+"ui.selection.primary" = { bg = "dark_blue" }
54
56
55−"ui.linenr" = { fg = "#858585" }
57+"ui.linenr" = { fg = "dark_gray" }
56−"ui.linenr.selected" = { fg = "#c6c6c6" }
58+"ui.linenr.selected" = { fg = "light_gray2" }
57
59
58−"ui.statusline" = { fg = "#ffffff", bg = "#007acc" }
60+"ui.statusline" = { fg = "white", bg = "blue" }
59−"ui.statusline.inactive" = { fg = "#ffffff", bg = "#007acc" }
61+"ui.statusline.inactive" = { fg = "white", bg = "blue" }
60
62
61"ui.text" = { fg = "text", bg = "background" }
63"ui.text" = { fg = "text", bg = "background" }
62−"ui.text.focus" = { fg = "#ffffff" }
64+"ui.text.focus" = { fg = "white" }
63
65
64−"warning" = { fg = "#cca700" }
66+"warning" = { fg = "gold2" }
65−"error" = { fg = "#ff1212" }
67+"error" = { fg = "red" }
66−"info" = { fg = "#75beff" }
68+"info" = { fg = "light_blue" }
67−"hint" = { fg = "#eeeeeeb3" }
69+"hint" = { fg = "light_gray3" }
68
70
69diagnostic = { modifiers = ["underlined"] }
71diagnostic = { modifiers = ["underlined"] }
70
72
71[palette]
73[palette]
74+white = "#ffffff"
75+orange = "#ce9178"
76+gold = "#d7ba7d"
77+gold2 = "#cca700"
78+pale_green = "#b5cea8"
79+dark_green = "#6A9955"
80+light_gray = "#d4d4d4"
81+light_gray2 = "#c6c6c6"
82+light_gray3 = "#eeeeee"
83+dark_gray = "#858585"
84+dark_gray2 = "#1e1e1e"
85+blue = "#007acc"
86+light_blue = "#75beff"
87+dark_blue = "#264f78"
88+red = "#ff1212"
89+
72type = "#4EC9B0"
90type = "#4EC9B0"
73keyword = "#569CD6"
91keyword = "#569CD6"
74−regex = "#CE9178"
75special = "#C586C0"
92special = "#C586C0"
76variable = "#9CDCFE"
93variable = "#9CDCFE"
77fn_declaration = "#DCDCAA"
94fn_declaration = "#DCDCAA"
runtime/themes/everforest_dark.toml+3−4
@@ -8,16 +8,16 @@
8# Email: sainnhe@gmail.com
8# Email: sainnhe@gmail.com
9# License: MIT License
9# License: MIT License
10
10
11−"escape" = "orange"
11+"constant.character.escape" = "orange"
12"type" = "yellow"
12"type" = "yellow"
13"constant" = "purple"
13"constant" = "purple"
14−"number" = "purple"
14+"constant.numeric" = "purple"
15"string" = "grey2"
15"string" = "grey2"
16"comment" = "grey0"
16"comment" = "grey0"
17"variable" = "fg"
17"variable" = "fg"
18"variable.builtin" = "blue"
18"variable.builtin" = "blue"
19"variable.parameter" = "fg"
19"variable.parameter" = "fg"
20−"variable.property" = "fg"
20+"variable.other.member" = "fg"
21"label" = "aqua"
21"label" = "aqua"
22"punctuation" = "grey2"
22"punctuation" = "grey2"
23"punctuation.delimiter" = "grey2"
23"punctuation.delimiter" = "grey2"
@@ -32,7 +32,6 @@
32"attribute" = "aqua"
32"attribute" = "aqua"
33"constructor" = "yellow"
33"constructor" = "yellow"
34"module" = "blue"
34"module" = "blue"
35−"property" = "fg"
36"special" = "orange"
35"special" = "orange"
37
36
38"ui.background" = { bg = "bg0" }
37"ui.background" = { bg = "bg0" }
runtime/themes/gruvbox.toml+3−4
@@ -9,8 +9,7 @@
9"punctuation.delimiter" = "orange1"
9"punctuation.delimiter" = "orange1"
10"operator" = "purple1"
10"operator" = "purple1"
11"special" = "purple0"
11"special" = "purple0"
12−"property" = "blue1"
13−"variable.property" = "blue1"
12+"variable.other.member" = "blue1"
14"variable" = "fg1"
13"variable" = "fg1"
15"variable.builtin" = "orange1"
14"variable.builtin" = "orange1"
16"variable.parameter" = "fg2"
15"variable.parameter" = "fg2"
@@ -24,8 +23,8 @@
24"constant" = { fg = "purple1" }
23"constant" = { fg = "purple1" }
25"constant.builtin" = { fg = "purple1", modifiers = ["bold"] }
24"constant.builtin" = { fg = "purple1", modifiers = ["bold"] }
26"string" = "green1"
25"string" = "green1"
27−"number" = "purple1"
26+"constant.numeric" = "purple1"
28−"escape" = { fg = "fg2", modifiers = ["bold"] }
27+"constant.character.escape" = { fg = "fg2", modifiers = ["bold"] }
29"label" = "aqua1"
28"label" = "aqua1"
30"module" = "aqua1"
29"module" = "aqua1"
31
30
runtime/themes/ingrid.toml+3−3
@@ -8,7 +8,7 @@
8"punctuation.delimiter" = "#C97270"
8"punctuation.delimiter" = "#C97270"
9"operator" = { fg = "#D74E50", modifiers = ["bold"] }
9"operator" = { fg = "#D74E50", modifiers = ["bold"] }
10"special" = "#D68482"
10"special" = "#D68482"
11−"property" = "#89BEB7"
11+"variable.other.member" = "#89BEB7"
12"variable" = "#A6B6CE"
12"variable" = "#A6B6CE"
13"variable.parameter" = "#89BEB7"
13"variable.parameter" = "#89BEB7"
14"type" = { fg = "#A6B6CE", modifiers = ["bold"] }
14"type" = { fg = "#A6B6CE", modifiers = ["bold"] }
@@ -22,8 +22,8 @@
22"constant" = "#D4A520"
22"constant" = "#D4A520"
23"constant.builtin" = "#D4A520"
23"constant.builtin" = "#D4A520"
24"string" = "#D74E50"
24"string" = "#D74E50"
25−"number" = "#D74E50"
25+"constant.numeric" = "#D74E50"
26−"escape" = { fg = "#D74E50", modifiers = ["bold"] }
26+"constant.character.escape" = { fg = "#D74E50", modifiers = ["bold"] }
27"label" = "#D68482"
27"label" = "#D68482"
28
28
29"module" = "#839A53"
29"module" = "#839A53"
runtime/themes/monokai.toml+4−3
@@ -7,7 +7,7 @@
7"type.builtin" = { fg = "#66D9EF" }
7"type.builtin" = { fg = "#66D9EF" }
8"type.enum.variant" = { fg = "text" }
8"type.enum.variant" = { fg = "text" }
9"constructor" = { fg = "text" }
9"constructor" = { fg = "text" }
10−"property" = { fg = "variable" }
10+"variable.other.member" = { fg = "variable" }
11
11
12"keyword" = { fg = "keyword" }
12"keyword" = { fg = "keyword" }
13"keyword.directive" = { fg = "keyword" }
13"keyword.directive" = { fg = "keyword" }
@@ -34,9 +34,10 @@
34"comment" = { fg = "#88846F" }
34"comment" = { fg = "#88846F" }
35
35
36"string" = { fg = "#e6db74" }
36"string" = { fg = "#e6db74" }
37+"constant.character" = { fg = "#e6db74" }
37"string.regexp" = { fg = "regex" }
38"string.regexp" = { fg = "regex" }
38−"number" = { fg = "#ae81ff" }
39+"constant.numeric" = { fg = "#ae81ff" }
39−"escape" = { fg = "#ae81ff" }
40+"constant.character.escape" = { fg = "#ae81ff" }
40
41
41"ui.background" = { fg = "text", bg = "background" }
42"ui.background" = { fg = "text", bg = "background" }
42
43
runtime/themes/nord.toml+3−3
@@ -59,7 +59,7 @@
59# nord9 - operator, tags, units, punctuations
59# nord9 - operator, tags, units, punctuations
60"punctuation.delimiter" = "nord9"
60"punctuation.delimiter" = "nord9"
61"operator" = { fg = "nord9" }
61"operator" = { fg = "nord9" }
62−"property" = "nord9"
62+"variable.other.member" = "nord9"
63
63
64# nord10 - keywords, special
64# nord10 - keywords, special
65"keyword" = { fg = "nord10" }
65"keyword" = { fg = "nord10" }
@@ -76,13 +76,13 @@
76
76
77# nord13 - warnings, escape characters, regex
77# nord13 - warnings, escape characters, regex
78"warning" = "nord13"
78"warning" = "nord13"
79−"escape" = { fg = "nord13" }
79+"constant.character.escape" = { fg = "nord13" }
80
80
81# nord14 - strings
81# nord14 - strings
82"string" = "nord14"
82"string" = "nord14"
83
83
84# nord15 - integer, floating point
84# nord15 - integer, floating point
85−"number" = "nord15"
85+"constant.numeric" = "nord15"
86
86
87[palette]
87[palette]
88nord0 = "#2e3440"
88nord0 = "#2e3440"
runtime/themes/rose_pine.toml+2−2
@@ -16,14 +16,14 @@
16"operator" = "rose"
16"operator" = "rose"
17"ui.text.focus" = { fg = "base05" }
17"ui.text.focus" = { fg = "base05" }
18"variable" = "text"
18"variable" = "text"
19−"number" = "iris"
19+"constant.numeric" = "iris"
20"constant" = "gold"
20"constant" = "gold"
21"attributes" = "gold"
21"attributes" = "gold"
22"type" = "foam"
22"type" = "foam"
23"ui.cursor.match" = { fg = "gold", modifiers = ["underlined"] }
23"ui.cursor.match" = { fg = "gold", modifiers = ["underlined"] }
24"string" = "gold"
24"string" = "gold"
25"property" = "foam"
25"property" = "foam"
26−"escape" = "subtle"
26+"constant.character.escape" = "subtle"
27"function" = "rose"
27"function" = "rose"
28"function.builtin" = "rose"
28"function.builtin" = "rose"
29"function.method" = "foam"
29"function.method" = "foam"
theme.toml+1−1
@@ -6,7 +6,7 @@ punctuation = "lavender"
6"punctuation.delimiter" = "lavender"
6"punctuation.delimiter" = "lavender"
7operator = "lilac"
7operator = "lilac"
8special = "honey"
8special = "honey"
9−property = "white"
9+variable.other.member = "white"
10variable = "lavender"
10variable = "lavender"
11# variable = "almond" # TODO: metavariables only
11# variable = "almond" # TODO: metavariables only
12# "variable.parameter" = { fg = "lavender", modifiers = ["underlined"] }
12# "variable.parameter" = { fg = "lavender", modifiers = ["underlined"] }