Skip to content

Commit 268734b

Browse files
connorlayShekhinah Memmel
authored and
Shekhinah Memmel
committed
Elixir: update tree-sitter queries (helix-editor#3645)
1 parent f76227a commit 268734b

File tree

2 files changed

+43
-9
lines changed

2 files changed

+43
-9
lines changed

runtime/queries/elixir/injections.scm

+42-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1+
; Elixir Code Comments
12
((comment) @injection.content
23
(#set! injection.language "comment"))
34

5+
; Elixir Regular Expressions
46
((sigil
57
(sigil_name) @_sigil_name
68
(quoted_content) @injection.content)
7-
(#match? @_sigil_name "^(r|R)$")
9+
(#match? @_sigil_name "^(R|r)$")
810
(#set! injection.language "regex")
911
(#set! injection.combined))
1012

11-
((sigil
12-
(sigil_name) @_sigil_name
13-
(quoted_content) @injection.content)
14-
(#eq? @_sigil_name "H")
15-
(#set! injection.language "heex")
16-
(#set! injection.combined))
17-
13+
; Elixir Markdown Documentation
1814
(unary_operator
1915
operator: "@"
2016
operand: (call
@@ -23,3 +19,41 @@
2319
(string (quoted_content) @injection.content)
2420
(sigil (quoted_content) @injection.content)
2521
])) (#set! injection.language "markdown"))
22+
23+
; Zigler Sigils
24+
((sigil
25+
(sigil_name) @_sigil_name
26+
(quoted_content) @injection.content)
27+
(#match? @_sigil_name "^(Z|z)$")
28+
(#set! injection.language "zig")
29+
(#set! injection.combined))
30+
31+
; Jason Sigils
32+
((sigil
33+
(sigil_name) @_sigil_name
34+
(quoted_content) @injection.content)
35+
(#match? @_sigil_name "^(J|j)$")
36+
(#set! injection.language "json")
37+
(#set! injection.combined))
38+
39+
; Phoenix Live View HEEx Sigils
40+
((sigil
41+
(sigil_name) @_sigil_name
42+
(quoted_content) @injection.content)
43+
(#eq? @_sigil_name "H")
44+
(#set! injection.language "heex")
45+
(#set! injection.combined))
46+
47+
; Phoenix Live View Component Macros
48+
(call
49+
(identifier) @_identifier
50+
(arguments
51+
(atom)+
52+
(keywords (pair
53+
((keyword) @_keyword (#eq? @_keyword "doc: "))
54+
[
55+
(string (quoted_content) @injection.content)
56+
(sigil (quoted_content) @injection.content)
57+
]))
58+
(#match? @_identifier "^(attr|slot)$")
59+
(#set! injection.language "markdown")))

runtime/queries/elixir/textobjects.scm

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
(do_block (_)* @test.inside)?)
3333
(#match? @_keyword "^(test|describe)$")) @test.around
3434

35-
(comment) @comment.around @comment.inside
35+
(comment)+ @comment.around @comment.inside

0 commit comments

Comments
 (0)