add tree-sitter-eex
EEx is an templating language for Elixir. Since the incremental
parsing refactor we can used combined injections which allows us
to add EEx support.
commit9d095e0fdc78ad42c033193dd980b6218c9484d6
authorMichael Davis <mcarsondavis@gmail.com>
dateTue 12 Apr 2022, 20:55 (5 years ago)
parent4ac94a5
book/src/generated/lang-support.md+1
@@ -9,6 +9,7 @@
99| css | ✓ | | | `vscode-css-language-server` |
1010| dart | ✓ | | ✓ | `dart` |
1111| dockerfile | ✓ | | | `docker-langserver` |
12+| eex | ✓ | | | |
1213| ejs | ✓ | | | |
1314| elixir | ✓ | | | `elixir-ls` |
1415| elm | ✓ | | | `elm-language-server` |
languages.toml+12
@@ -1113,3 +1113,15 @@ grammar = "embedded-template"
11131113[[grammar]]
11141114name = "embedded-template"
11151115source = { git = "https://github.com/tree-sitter/tree-sitter-embedded-template", rev = "d21df11b0ecc6fd211dbe11278e92ef67bd17e97" }
1116+
1117+[[language]]
1118+name = "eex"
1119+scope = "source.eex"
1120+injection-regex = "eex"
1121+file-types = ["eex"]
1122+roots = []
1123+indent = { tab-width = 2, unit = " " }
1124+
1125+[[grammar]]
1126+name = "eex"
1127+source = { git = "https://github.com/connorlay/tree-sitter-eex", rev = "f742f2fe327463335e8671a87c0b9b396905d1d1" }
runtime/queries/eex/highlights.scmnew file+6
@@ -0,0 +1,6 @@
1+; https://github.com/connorlay/tree-sitter-eex/blob/f742f2fe327463335e8671a87c0b9b396905d1d1/queries/highlights.scm
2+
3+; wrapping in (directive .. ) prevents us from highlighting '%>' in a comment as a keyword
4+(directive ["<%" "<%=" "<%%" "<%%=" "%>"] @keyword)
5+
6+(comment) @comment
runtime/queries/eex/injections.scmnew file+9
@@ -0,0 +1,9 @@
1+; https://github.com/connorlay/tree-sitter-eex/blob/f742f2fe327463335e8671a87c0b9b396905d1d1/queries/injections.scm
2+
3+((directive (expression) @injection.content)
4+ (#set! injection.language "elixir"))
5+
6+((partial_expression) @injection.content
7+ (#set! injection.language "elixir")
8+ (#set! injection.include-children)
9+ (#set! injection.combined))