diff --git a/.config/helix/languages.toml b/.config/helix/languages.toml index 9261a2cb..4db4e1a1 100644 --- a/.config/helix/languages.toml +++ b/.config/helix/languages.toml @@ -90,3 +90,12 @@ file-types = ["eml"] name = "mail" source.path = "/home/fic/dev/tree-sitter-mail" # source = { git = "https://github.com/stevenxxiu/tree-sitter-mail", rev = "e3d63ac2093e22777cb30d70b9264f48814622ad" } + +[[language]] +name = "test" +scope = "source.test" +file-types = [{ glob = "test/corpus/*.txt" }] + +[[grammar]] +name = "test" +source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-test", rev = "93746e2e387ae757d21088ab0ab5657efffb973e" } diff --git a/.config/helix/runtime/grammars/test.so b/.config/helix/runtime/grammars/test.so new file mode 100755 index 00000000..3536e513 Binary files /dev/null and b/.config/helix/runtime/grammars/test.so differ diff --git a/.config/helix/runtime/queries/test/highlights.scm b/.config/helix/runtime/queries/test/highlights.scm new file mode 100644 index 00000000..68f09961 --- /dev/null +++ b/.config/helix/runtime/queries/test/highlights.scm @@ -0,0 +1,15 @@ +(name) @markup.heading.1 + +(attribute) @attribute + +(attribute + language: (parameter) @string) + +(attribute + platform: (parameter) @constant.builtin) + +[ + (separator) + ")" + "(" +] @punctuation diff --git a/.config/helix/runtime/queries/test/injections.scm b/.config/helix/runtime/queries/test/injections.scm new file mode 100644 index 00000000..685890a0 --- /dev/null +++ b/.config/helix/runtime/queries/test/injections.scm @@ -0,0 +1,15 @@ +(test + (header + (name) + (attributes + . ; skip over non-language attributes + (attribute + !language)* + . ; select only the first language attribute + (attribute + language: (parameter) @injection.language))) + (input) @injection.content) + +((test + (output) @injection.content) + (#set! injection.language "tsq"))