Skip to content

Commit e19e4a8

Browse files
Add ECR support
1 parent 719e0a9 commit e19e4a8

File tree

5 files changed

+56
-1
lines changed

5 files changed

+56
-1
lines changed

extension.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
authors = ["Margret Riegert <[email protected]>"]
2-
description = "Syntax highlighting and LSP support for Crystal"
2+
description = "Syntax highlighting and LSP support for Crystal & ECR"
33
id = "crystal"
44
name = "Crystal"
55
repository = "https://github.com/crystal-lang-tools/zed-crystal"
@@ -10,6 +10,10 @@ version = "0.0.2"
1010
commit = "cd3ae0751a58bca9fe875e580102578f5228a5a1"
1111
repository = "https://github.com/crystal-lang-tools/tree-sitter-crystal"
1212

13+
[grammars.ecr]
14+
commit = "7cbfc5d1ced8572e8702174c86b20dd29a675da5"
15+
repository = "https://github.com/crystal-lang-tools/tree-sitter-ecr"
16+
1317
[language_servers.crystalline]
1418
language = "Crystal"
1519
name = "crystalline"

languages/ecr/brackets.scm

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
("<%" @open "%>" @close)
2+
("<%-" @open "%>" @close)
3+
("<%=" @open "%>" @close)
4+
("<%-=" @open "%>" @close)
5+
("<%%" @open "%>" @close)
6+
("<%%-" @open "%>" @close)
7+
("<%%=" @open "%>" @close)
8+
("<%%-=" @open "%>" @close)
9+
("<%#" @open "%>" @close)
10+
("<%-#" @open "%>" @close)
11+
("<%" @open "-%>" @close)
12+
("<%-" @open "-%>" @close)
13+
("<%=" @open "-%>" @close)
14+
("<%-=" @open "-%>" @close)
15+
("<%%" @open "-%>" @close)
16+
("<%%-" @open "-%>" @close)
17+
("<%%=" @open "-%>" @close)
18+
("<%%-=" @open "-%>" @close)
19+
("<%#" @open "-%>" @close)
20+
("<%-#" @open "-%>" @close)

languages/ecr/config.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
autoclose_before = ">})"
2+
block_comment = ["<%#", "%>"]
3+
brackets = [
4+
{start = "<", end = ">", close = true, newline = true},
5+
]
6+
grammar = "ecr"
7+
name = "ECR"
8+
path_suffixes = ["ecr"]

languages/ecr/highlights.scm

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
(comment_directive) @comment
2+
3+
[
4+
"<%"
5+
"<%-"
6+
"<%="
7+
"<%-="
8+
"<%%"
9+
"<%%-"
10+
"<%%="
11+
"<%%-="
12+
"<%#"
13+
"<%-#"
14+
"%>"
15+
"-%>"
16+
] @keyword

languages/ecr/injections.scm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
((code) @content
2+
(#set! "language" "crystal")
3+
(#set! "combined"))
4+
5+
((content) @content
6+
(#set! "language" "html")
7+
(#set! "combined"))

0 commit comments

Comments
 (0)