Skip to content

Commit d4f21b8

Browse files
committed
Adjust fallback captures
Switch module and sigil modifier captures from prefixed fallbacks to secondary capture fallbacks
1 parent 30c2e3e commit d4f21b8

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

.tsqueryrc.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@
4848
"keyword.operator": "Captures operator keywords",
4949
"keyword.operator.regex": "Captures regex mode modifiers",
5050
"label": "Captures labels",
51-
"label.modifier": "Captures modifiers",
5251
"link_text": "Captures link text",
5352
"link_uri": "Captures link URIs",
53+
"modifier": "Captures modifiers",
54+
"module": "Captures modules",
55+
"module.struct": "Captures structs",
5456
"number": "Captures numeric values",
5557
"operator": "Captures operators",
5658
"predictive": "Captures predictive text",
@@ -76,8 +78,6 @@
7678
"type": "Captures types",
7779
"type.builtin": "Captures built-in types",
7880
"type.interface": "Captures interface types",
79-
"type.module": "Captures modules",
80-
"type.module.struct": "Captures structs",
8181
"type.spec": "Captures typespecs",
8282
"type.super": "Captures superclass types",
8383
"variable": "Captures variables",

languages/elixir/highlights.scm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,23 @@
6060
(char) @constant.char
6161

6262
; Modules
63-
(alias) @type.module
63+
(alias) @type @module
6464

6565
; Erlang modules
6666
(call
6767
target: (dot
6868
left: [
6969
(atom)
7070
(quoted_atom)
71-
] @type.module))
71+
] @type @module))
7272

7373
; Structs
7474
(struct
7575
[
7676
(alias)
7777
(atom)
7878
(quoted_atom)
79-
] @type.module.struct)
79+
] @type @module.struct)
8080

8181
; Regular identifiers
8282
(identifier) @variable
@@ -111,7 +111,7 @@
111111
quoted_end: _ @string.special) @string.special
112112

113113
; Sigil modifiers
114-
(sigil_modifiers) @label.modifier
114+
(sigil_modifiers) @label @modifier
115115

116116
; String/charlist sigils
117117
(sigil
@@ -197,7 +197,7 @@
197197
operand: [
198198
(atom)
199199
(quoted_atom)
200-
] @type.module)
200+
] @type @module)
201201

202202
; Capture functions from a map field/variable holding a module
203203
(unary_operator
@@ -236,7 +236,7 @@
236236
right: [
237237
(atom)
238238
(quoted_atom)
239-
] @type.module)
239+
] @type @module)
240240

241241
; Piping into a map field/variable holding a module that has no parentheses
242242
(binary_operator

languages/heex/highlights.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
; HEEx components are highlighted the same as Elixir modules and functions
4747
(component_name
4848
[
49-
(module) @type.module
49+
(module) @type @module
5050
(function) @function
5151
"." @operator
5252
])

0 commit comments

Comments
 (0)