Skip to content

Commit ff8d494

Browse files
Update to latest tree-sitter-crystal
Macro injections
1 parent e72f86a commit ff8d494

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

extension.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ schema_version = 1
77
version = "0.0.2"
88

99
[grammars.crystal]
10-
commit = "3f5b4d3ee4956742c8ba609e3d5a0f4677d5c319"
10+
commit = "cd3ae0751a58bca9fe875e580102578f5228a5a1"
1111
repository = "https://github.com/crystal-lang-tools/tree-sitter-crystal"
1212

1313
[language_servers.crystalline]

languages/crystal/injections.scm

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
11
(heredoc_body
2-
(heredoc_content) @content
3-
(heredoc_end) @language
4-
(#downcase! @language))
2+
(heredoc_content) @injection.content
3+
(heredoc_end) @injection.language
4+
(#downcase! injection.language))
5+
6+
(macro_def
7+
body: (expressions) @injection.content
8+
(#set! injection.language "crystal"))
9+
10+
(macro_begin
11+
body: (expressions) @injection.content
12+
(#set! injection.language "crystal"))
13+
14+
(macro_if
15+
then: (expressions) @injection.content
16+
(#set! injection.language "crystal"))
17+
18+
(macro_elsif
19+
then: (expressions) @injection.content
20+
(#set! injection.language "crystal"))
21+
22+
(macro_else
23+
body: (expressions) @injection.content
24+
(#set! injection.language "crystal"))
25+
26+
(macro_unless
27+
then: (expressions) @injection.content
28+
(#set! injection.language "crystal"))
29+
30+
(macro_for
31+
body: (expressions) @injection.content
32+
(#set! injection.language "crystal"))
33+
34+
(macro_verbatim
35+
body: (expressions) @injection.content
36+
(#set! injection.language "crystal"))

0 commit comments

Comments
 (0)