From 494306ad7ae8ffb45d4d7d906528b64812eee3a5 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sat, 9 Apr 2022 18:23:06 -0500 Subject: add tree-sitter-embedded-template (erb & ejs) (#2055) After the incremental parsing rewrite for injections (which was released in 22.03 https://helix-editor.com/news/release-22-03-highlights/#incremental-injection-parsing-rewrite), we can now do combined injections which lets us pull in some templating grammars. The most notable of those is embedded-template - a pretty straightforward grammar that covers ERB and EJS. The grammar and highlights queries are shared between the two but they have different injections.--- runtime/queries/erb/highlights.scm | 1 + runtime/queries/erb/injections.scm | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 runtime/queries/erb/highlights.scm create mode 100644 runtime/queries/erb/injections.scm (limited to 'runtime/queries/erb') diff --git a/runtime/queries/erb/highlights.scm b/runtime/queries/erb/highlights.scm new file mode 100644 index 00000000..38830615 --- /dev/null +++ b/runtime/queries/erb/highlights.scm @@ -0,0 +1 @@ +; inherits: ejs diff --git a/runtime/queries/erb/injections.scm b/runtime/queries/erb/injections.scm new file mode 100644 index 00000000..2824f7a0 --- /dev/null +++ b/runtime/queries/erb/injections.scm @@ -0,0 +1,7 @@ +((content) @injection.content + (#set! injection.language "html") + (#set! injection.combined)) + +((code) @injection.content + (#set! injection.language "ruby") + (#set! injection.combined)) -- cgit v1.2.3-70-g09d2