From 9d095e0fdc78ad42c033193dd980b6218c9484d6 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 12 Apr 2022 20:55:30 -0500 Subject: 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. --- runtime/queries/eex/highlights.scm | 6 ++++++ runtime/queries/eex/injections.scm | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 runtime/queries/eex/highlights.scm create mode 100644 runtime/queries/eex/injections.scm (limited to 'runtime/queries') diff --git a/runtime/queries/eex/highlights.scm b/runtime/queries/eex/highlights.scm new file mode 100644 index 00000000..e900a43d --- /dev/null +++ b/runtime/queries/eex/highlights.scm @@ -0,0 +1,6 @@ +; https://github.com/connorlay/tree-sitter-eex/blob/f742f2fe327463335e8671a87c0b9b396905d1d1/queries/highlights.scm + +; wrapping in (directive .. ) prevents us from highlighting '%>' in a comment as a keyword +(directive ["<%" "<%=" "<%%" "<%%=" "%>"] @keyword) + +(comment) @comment diff --git a/runtime/queries/eex/injections.scm b/runtime/queries/eex/injections.scm new file mode 100644 index 00000000..4686bf4d --- /dev/null +++ b/runtime/queries/eex/injections.scm @@ -0,0 +1,9 @@ +; https://github.com/connorlay/tree-sitter-eex/blob/f742f2fe327463335e8671a87c0b9b396905d1d1/queries/injections.scm + +((directive (expression) @injection.content) + (#set! injection.language "elixir")) + +((partial_expression) @injection.content + (#set! injection.language "elixir") + (#set! injection.include-children) + (#set! injection.combined)) -- cgit v1.2.3-70-g09d2