diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 360e1a625..26582b459 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -232,6 +232,7 @@ | teal | ✓ | | | `teal-language-server` | | templ | ✓ | | | `templ` | | tera | ✓ | | | | +| test | ✓ | | | | | textproto | ✓ | ✓ | ✓ | | | tfvars | ✓ | | ✓ | `terraform-ls` | | thrift | ✓ | | | | diff --git a/languages.toml b/languages.toml index 96d695646..d125d6e40 100644 --- a/languages.toml +++ b/languages.toml @@ -4229,6 +4229,15 @@ indent = { tab-width = 2, unit = " " } name = "ghostty" source = { git = "https://github.com/bezhermoso/tree-sitter-ghostty" , rev = "8438a93b44367e962b2ea3a3b6511885bebd196a" } +[[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" } + [[language]] name = "tera" scope = "source.tera" diff --git a/runtime/queries/test/highlights.scm b/runtime/queries/test/highlights.scm new file mode 100644 index 000000000..68f099613 --- /dev/null +++ b/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/runtime/queries/test/injections.scm b/runtime/queries/test/injections.scm new file mode 100644 index 000000000..685890a05 --- /dev/null +++ b/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"))