diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-12-24 12:52:21 +0100 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-01-19 16:58:37 +0100 |
| commit | 10dd49958c96f86c8247c715bd20a6681afc1d8b (patch) | |
| tree | 511849caff160e818f4dd08a6106137dcadb620d | |
| parent | feat(injections): add printf format strings (diff) | |
| download | nvim-treesitter-10dd49958c96f86c8247c715bd20a6681afc1d8b.tar nvim-treesitter-10dd49958c96f86c8247c715bd20a6681afc1d8b.tar.gz nvim-treesitter-10dd49958c96f86c8247c715bd20a6681afc1d8b.tar.bz2 nvim-treesitter-10dd49958c96f86c8247c715bd20a6681afc1d8b.tar.lz nvim-treesitter-10dd49958c96f86c8247c715bd20a6681afc1d8b.tar.xz nvim-treesitter-10dd49958c96f86c8247c715bd20a6681afc1d8b.tar.zst nvim-treesitter-10dd49958c96f86c8247c715bd20a6681afc1d8b.zip | |
chore(tests): consistent captures
60 files changed, 872 insertions, 873 deletions
diff --git a/tests/query/highlights/bash/double-parens.sh b/tests/query/highlights/bash/double-parens.sh index 1f7aee4e4..8d841d170 100644 --- a/tests/query/highlights/bash/double-parens.sh +++ b/tests/query/highlights/bash/double-parens.sh @@ -1,6 +1,6 @@ if (( $(tree-sitter parse test/Petalisp/**/*.lisp -q | wc -l) > 2 )); then -# ^ punctuation.special -# ^ punctuation.special -# ^ punctuation.bracket +# ^ @punctuation.special +# ^ @punctuation.special +# ^ @punctuation.bracket exit 1 fi diff --git a/tests/query/highlights/clojure/test.clj b/tests/query/highlights/clojure/test.clj index ab9e46d9a..f40e9b0c4 100644 --- a/tests/query/highlights/clojure/test.clj +++ b/tests/query/highlights/clojure/test.clj @@ -1,52 +1,52 @@ (ns test {:clj-kondo/ignore true}) -; <- punctuation.bracket -; ^ include -; ^ namespace +; <- @punctuation.bracket +; ^ @include +; ^ @namespace ; asdf -;^^^^^^ comment +;^^^^^^ @comment #_ abc -;^^^^^^ comment +;^^^^^^ @comment (func obj) -;^^^^ function.call -; ^^^ variable +;^^^^ @function.call +; ^^^ @variable #(+ % %1 %&) -;^ punctuation.special -; ^ function.call -; ^ ^^ ^^ variable.builtin +;^ @punctuation.special +; ^ @function.call +; ^ ^^ ^^ @variable.builtin & -;^ parameter +;^ @parameter ->abc -;^^^^^ constructor +;^^^^^ @constructor ->>abc -;^^^^^^ variable +;^^^^^^ @variable *1 *2 *3 *e -;^^ ^^ ^^ ^^ variable.builtin +;^^ ^^ ^^ ^^ @variable.builtin (.method) -;^^^^^^^ method +;^^^^^^^ @method (.-field) -;^^^^^^^ field +;^^^^^^^ @field Abc/method -;^^^^^^^^^^ field +;^^^^^^^^^^ @field (Abc/method) -;^^^^^^^^^^ method +;^^^^^^^^^^ @method Abc -;^^^ type +;^^^ @type abc. -;^^^^ type +;^^^^ @type ^abc -;^ punctuation.special +;^ @punctuation.special diff --git a/tests/query/highlights/cpp/concepts.cpp b/tests/query/highlights/cpp/concepts.cpp index 27aed7a70..6fe6af436 100644 --- a/tests/query/highlights/cpp/concepts.cpp +++ b/tests/query/highlights/cpp/concepts.cpp @@ -1,14 +1,14 @@ template <class T, class U> concept Derived = std::is_base_of<U, T>::value; -// ^ keyword -// ^ type.definition +// ^ @keyword +// ^ @type.definition template<typename T> concept Hashable = requires(T a) { -// ^ keyword -// ^ parameter -// ^ type +// ^ @keyword +// ^ @parameter +// ^ @type { std::hash<T>{}(a) } -> std::convertible_to<std::size_t>; typename CommonType<T, U>; // CommonType<T, U> is valid and names a type { CommonType<T, U>{std::forward<T>(t)} }; @@ -18,5 +18,5 @@ concept Hashable = requires(T a) { template<typename T> requires requires (T x) { x + x; } // ad-hoc constraint, note keyword used twice -// ^ keyword +// ^ @keyword T add(T a, T b) { return a + b; } diff --git a/tests/query/highlights/cpp/test.cpp b/tests/query/highlights/cpp/test.cpp index 77e3be698..3f903a55f 100644 --- a/tests/query/highlights/cpp/test.cpp +++ b/tests/query/highlights/cpp/test.cpp @@ -1,19 +1,19 @@ #include <iostream> #include <cstdlib> -// ^ include -// ^ string +// ^ @include +// ^ @string auto main( int argc, char** argv ) -> int -// ^ type.builtin - // ^ parameter - // ^ type.builtin - // ^ type.builtin - // ^ operator +// ^ @type.builtin + // ^ @parameter + // ^ @type.builtin + // ^ @type.builtin + // ^ @operator { std::cout << "Hello world!" << std::endl; - // ^ punctuation.delimiter + // ^ @punctuation.delimiter return EXIT_SUCCESS; - // ^ keyword.return - // ^ constant + // ^ @keyword.return + // ^ @constant } diff --git a/tests/query/highlights/ecma/test.ts b/tests/query/highlights/ecma/test.ts index d35cf8272..9ecd50c76 100644 --- a/tests/query/highlights/ecma/test.ts +++ b/tests/query/highlights/ecma/test.ts @@ -1,32 +1,32 @@ class H { pub_field = "Hello"; - // ^ property + // ^ @property #priv_field = "World!"; - // ^ property + // ^ @property #private_method() { - // ^ method + // ^ @method return `${this.pub_field} -- ${this.#priv_field}`; - // ^ property - // ^ property + // ^ @property + // ^ @property } public_method() { - // ^ method + // ^ @method return this.#private_method(); - // ^ method.call + // ^ @method.call } ok() { return this.public_method(); - // ^ method.call + // ^ @method.call } } function doSomething(options) { const { enable: on, - // ^ punctuation.delimiter + // ^ @punctuation.delimiter } = options } diff --git a/tests/query/highlights/fusion/basic.fusion b/tests/query/highlights/fusion/basic.fusion index e4c4d6afc..e63c86eea 100644 --- a/tests/query/highlights/fusion/basic.fusion +++ b/tests/query/highlights/fusion/basic.fusion @@ -1,60 +1,60 @@ include: SomeFile.fusion -//<- include -// ^text.uri +//<- @include +// ^ @text.uri namespace: ns = Neos.Fusion.Space -//<- keyword -// ^namespace -// ^operator -// ^namespace +//<- @keyword +// ^ @namespace +// ^ @operator +// ^ @namespace prototype(MyType) < prototype(ns:SuperType) { //<-keyword -// ^punctuation.bracket -// ^type -// ^punctuation.bracket -// ^operator -// ^namespace -// ^type +// ^ @punctuation.bracket +// ^ @type +// ^ @punctuation.bracket +// ^ @operator +// ^ @namespace +// ^ @type deleteProp > - // ^operator + // ^ @operator string = 'value' - //<- property - // ^operator - // ^string + //<- @property + // ^ @operator + // ^ @string number = 10.2 - // ^number + // ^ @number null = null - // ^constant.builtin + // ^ @constant.builtin boolean = true - // ^boolean + // ^ @boolean property.inner = "value" - //<- property - // ^property + //<- @property + // ^ @property property.@meta = "value" - //<- property - // ^attribute + //<- @property + // ^ @attribute property.type = SomeType - //<- property - // ^type + //<- @property + // ^ @type property.aliasedType = ns:SomeType - //<- property - // ^namespace - // ^type + //<- @property + // ^ @namespace + // ^ @type property.fullQualifiedType = SomeNamespace:SomeType - //<- property - // ^namespace - // ^type + //<- @property + // ^ @namespace + // ^ @type } diff --git a/tests/query/highlights/gitattributes/test.gitattributes b/tests/query/highlights/gitattributes/test.gitattributes index 1d398db41..a16c233e6 100644 --- a/tests/query/highlights/gitattributes/test.gitattributes +++ b/tests/query/highlights/gitattributes/test.gitattributes @@ -1,37 +1,37 @@ [attr]nodiff -diff -merge -# <- preproc -# ^^^^^^ property -# ^ operator -# ^^^^ variable.builtin -# ^ operator -# ^^^^^ variable.builtin +# <- @preproc +# ^^^^^^ @property +# ^ @operator +# ^^^^ @variable.builtin +# ^ @operator +# ^^^^^ @variable.builtin vendor/** linguist-vendored=true -# ^ punctuation.delimiter -# ^^ character.special -# ^^^^^^^^^^^^^^^^^ parameter -# ^ operator -# ^^^^ boolean +# ^ @punctuation.delimiter +# ^^ @character.special +# ^^^^^^^^^^^^^^^^^ @parameter +# ^ @operator +# ^^^^ @boolean [^._]-[[:lower:]] !something -# ^ punctuation.bracket -# ^ operator -# ^^ string.special -# ^ punctuation.bracket -# ^ punctuation.bracket -# ^^^^^^^^^ constant -# ^ punctuation.bracket -# ^ operator -# ^^^^^^^^^^ parameter +# ^ @punctuation.bracket +# ^ @operator +# ^^ @string.special +# ^ @punctuation.bracket +# ^ @punctuation.bracket +# ^^^^^^^^^ @constant +# ^ @punctuation.bracket +# ^ @operator +# ^^^^^^^^^^ @parameter "_\u4E00\t\56txt" encoding=UTF-16 -# <- punctuation.special -# ^^^^^^ string.escape -# ^^ string.escape -# ^^^ string.escape -# ^ punctuation.special -# ^^^^^^^^ variable.builtin -# ^ operator -# ^^^^^^ string +# <- @punctuation.special +# ^^^^^^ @string.escape +# ^^ @string.escape +# ^^^ @string.escape +# ^ @punctuation.special +# ^^^^^^^^ @variable.builtin +# ^ @operator +# ^^^^^^ @string # vim:ft=gitattributes: diff --git a/tests/query/highlights/gleam/assert.gleam b/tests/query/highlights/gleam/assert.gleam index 3711339bb..d36716a3f 100644 --- a/tests/query/highlights/gleam/assert.gleam +++ b/tests/query/highlights/gleam/assert.gleam @@ -1,13 +1,13 @@ pub fn main() { assert Ok(i) = parse_int("123") - // <- exception - // ^^ constructor - // ^ punctuation.bracket - // ^ variable - // ^ punctuation.bracket - // ^ operator - // ^^^^^^^^^ function.call - // ^ punctuation.bracket - // ^^^^^ string - // ^ punctuation.bracket + // <- @exception + // ^^ @constructor + // ^ @punctuation.bracket + // ^ @variable + // ^ @punctuation.bracket + // ^ @operator + // ^^^^^^^^^ @function.call + // ^ @punctuation.bracket + // ^^^^^ @string + // ^ @punctuation.bracket } diff --git a/tests/query/highlights/gleam/function.gleam b/tests/query/highlights/gleam/function.gleam index cf2fbf969..aed4879dc 100644 --- a/tests/query/highlights/gleam/function.gleam +++ b/tests/query/highlights/gleam/function.gleam @@ -1,127 +1,127 @@ pub fn add(x: Int, y: Int) -> Int { -// <- type.qualifier -// ^^ keyword.function -// ^^^ function -// ^ punctuation.bracket -// ^ parameter -// ^ punctuation.delimiter -// ^^^ type.builtin -// ^ punctuation.delimiter -// ^ parameter -// ^ punctuation.delimiter -// ^^^ type.builtin -// ^ punctuation.bracket -// ^ punctuation.delimiter -// ^^^ type.builtin -// ^ punctuation.bracket +// <- @type.qualifier +// ^^ @keyword.function +// ^^^ @function +// ^ @punctuation.bracket +// ^ @parameter +// ^ @punctuation.delimiter +// ^^^ @type.builtin +// ^ @punctuation.delimiter +// ^ @parameter +// ^ @punctuation.delimiter +// ^^^ @type.builtin +// ^ @punctuation.bracket +// ^ @punctuation.delimiter +// ^^^ @type.builtin +// ^ @punctuation.bracket } -// <- punctuation.bracket +// <- @punctuation.bracket pub fn twice(f: fn(t) -> t, x: t) -> t { -// <- type.qualifier -// ^ keyword.function -// ^^^^^ function -// ^ punctuation.bracket -// ^ parameter -// ^ punctuation.delimiter -// ^^ keyword.function -// ^ punctuation.bracket -// ^ type -// ^ punctuation.bracket -// ^^ punctuation.delimiter -// ^ type -// ^ punctuation.delimiter -// ^ parameter -// ^ punctuation.delimiter -// ^ type -// ^ punctuation.bracket -// ^^ punctuation.delimiter -// ^ type -// ^ punctuation.bracket +// <- @type.qualifier +// ^ @keyword.function +// ^^^^^ @function +// ^ @punctuation.bracket +// ^ @parameter +// ^ @punctuation.delimiter +// ^^ @keyword.function +// ^ @punctuation.bracket +// ^ @type +// ^ @punctuation.bracket +// ^^ @punctuation.delimiter +// ^ @type +// ^ @punctuation.delimiter +// ^ @parameter +// ^ @punctuation.delimiter +// ^ @type +// ^ @punctuation.bracket +// ^^ @punctuation.delimiter +// ^ @type +// ^ @punctuation.bracket } -// <- punctuation.bracket +// <- @punctuation.bracket fn list_of_two(my_value: a) -> List(a) { -// <- keyword.function -// ^ function -// ^ punctuation.bracket -// ^ parameter -// ^ punctuation.delimiter -// ^ type -// ^ punctuation.bracket -// ^ punctuation.delimiter -// ^^^^ type.builtin -// ^ punctuation.bracket -// ^ type -// ^ punctuation.bracket -// ^ punctuation.bracket +// <- @keyword.function +// ^ @function +// ^ @punctuation.bracket +// ^ @parameter +// ^ @punctuation.delimiter +// ^ @type +// ^ @punctuation.bracket +// ^ @punctuation.delimiter +// ^^^^ @type.builtin +// ^ @punctuation.bracket +// ^ @type +// ^ @punctuation.bracket +// ^ @punctuation.bracket } -// <- punctuation.bracket +// <- @punctuation.bracket fn replace( -// <- keyword.function -// ^^^^^^^ function -// ^ punctuation.bracket +// <- @keyword.function +// ^^^^^^^ @function +// ^ @punctuation.bracket in string: String, - // <- label - // ^^^^^^ parameter - // ^ punctuation.delimiter - // ^^^^^^ type.builtin - // ^ punctuation.delimiter + // <- @label + // ^^^^^^ @parameter + // ^ @punctuation.delimiter + // ^^^^^^ @type.builtin + // ^ @punctuation.delimiter each pattern: String, - // <- label - // ^^^^^^^ parameter - // ^ punctuation.delimiter - // ^^^^^^ type.builtin - // ^ punctuation.delimiter + // <- @label + // ^^^^^^^ @parameter + // ^ @punctuation.delimiter + // ^^^^^^ @type.builtin + // ^ @punctuation.delimiter with replacement: String, - // <- label - // ^^^^^^^^^^^ parameter - // ^ punctuation.delimiter - // ^^^^^^ type.builtin - // ^ punctuation.delimiter + // <- @label + // ^^^^^^^^^^^ @parameter + // ^ @punctuation.delimiter + // ^^^^^^ @type.builtin + // ^ @punctuation.delimiter ) { replace(in: "A,B,C", each: ",", with: " ") - // <- function.call - // ^ punctuation.bracket - // ^^ label - // ^ punctuation.delimiter - // ^^^^^^^ string - // ^ punctuation.delimiter - // ^^^^ label - // ^ punctuation.delimiter - // ^^^ string - // ^ punctuation.delimiter - // ^^^^ label - // ^ punctuation.delimiter - // ^^^ string - // ^ punctuation.bracket + // <- @function.call + // ^ @punctuation.bracket + // ^^ @label + // ^ @punctuation.delimiter + // ^^^^^^^ @string + // ^ @punctuation.delimiter + // ^^^^ @label + // ^ @punctuation.delimiter + // ^^^ @string + // ^ @punctuation.delimiter + // ^^^^ @label + // ^ @punctuation.delimiter + // ^^^ @string + // ^ @punctuation.bracket } -// <- punctuation.bracket +// <- @punctuation.bracket pub external fn random_float() -> Float = "rand" "uniform" -// <- type.qualifier -// ^^^^^^^^ type.qualifier -// ^^ keyword.function -// ^^^^^^^^^^^^ function -// ^ punctuation.bracket -// ^ punctuation.bracket -// ^^ punctuation.delimiter -// ^^^^^ type.builtin -// ^ operator -// ^^^^^^ namespace -// ^^^^^^^^^ function +// <- @type.qualifier +// ^^^^^^^^ @type.qualifier +// ^^ @keyword.function +// ^^^^^^^^^^^^ @function +// ^ @punctuation.bracket +// ^ @punctuation.bracket +// ^^ @punctuation.delimiter +// ^^^^^ @type.builtin +// ^ @operator +// ^^^^^^ @namespace +// ^^^^^^^^^ @function pub external fn inspect(a) -> a = "Elixir.IO" "inspect" -// <- type.qualifier -// ^^^^^^^^ type.qualifier -// ^^ keyword.function -// ^^^^^^^ function -// ^ punctuation.bracket -// ^ type -// ^ punctuation.bracket -// ^^ punctuation.delimiter -// ^ type -// ^ operator -// ^^^^^^^^^^^ namespace -// ^^^^^^^^^ function +// <- @type.qualifier +// ^^^^^^^^ @type.qualifier +// ^^ @keyword.function +// ^^^^^^^ @function +// ^ @punctuation.bracket +// ^ @type +// ^ @punctuation.bracket +// ^^ @punctuation.delimiter +// ^ @type +// ^ @operator +// ^^^^^^^^^^^ @namespace +// ^^^^^^^^^ @function diff --git a/tests/query/highlights/gleam/import.gleam b/tests/query/highlights/gleam/import.gleam index c48b38199..3ee141513 100644 --- a/tests/query/highlights/gleam/import.gleam +++ b/tests/query/highlights/gleam/import.gleam @@ -1,22 +1,22 @@ import gleam/io -// <- include -// ^ namespace -// ^ operator -// ^ namespace +// <- @include +// ^ @namespace +// ^ @operator +// ^ @namespace import cat as kitten -// <- include -// ^ namespace -// ^ keyword -// ^ namespace +// <- @include +// ^ @namespace +// ^ @keyword +// ^ @namespace import animal/cat.{Cat, stroke} -// <- include -// ^ namespace -// ^ operator -// ^ punctuation.delimiter -// ^ punctuation.bracket -// ^^^ type -// ^ punctuation.delimiter -// ^^^^^^ function -// ^ punctuation.bracket +// <- @include +// ^ @namespace +// ^ @operator +// ^ @punctuation.delimiter +// ^ @punctuation.bracket +// ^^^ @type +// ^ @punctuation.delimiter +// ^^^^^^ @function +// ^ @punctuation.bracket diff --git a/tests/query/highlights/gleam/pipe.gleam b/tests/query/highlights/gleam/pipe.gleam index d0341217b..c696b0227 100644 --- a/tests/query/highlights/gleam/pipe.gleam +++ b/tests/query/highlights/gleam/pipe.gleam @@ -1,18 +1,18 @@ pub fn run() { 1 - // <- number + // <- @number |> add(_, 2) - // <- operator - // ^^^ function.call - // ^ punctuation.bracket - // ^ comment - // ^ punctuation.delimiter - // ^ number - // ^ punctuation.bracket + // <- @operator + // ^^^ @function.call + // ^ @punctuation.bracket + // ^ @comment + // ^ @punctuation.delimiter + // ^ @number + // ^ @punctuation.bracket |> add(3) - // <- operator - // ^^^ function.call - // ^ punctuation.bracket - // ^ number - // ^ punctuation.bracket + // <- @operator + // ^^^ @function.call + // ^ @punctuation.bracket + // ^ @number + // ^ @punctuation.bracket } diff --git a/tests/query/highlights/gleam/todo.gleam b/tests/query/highlights/gleam/todo.gleam index 27038bb73..b7384ecbd 100644 --- a/tests/query/highlights/gleam/todo.gleam +++ b/tests/query/highlights/gleam/todo.gleam @@ -1,7 +1,7 @@ fn favourite_number() -> Int { todo("We're going to decide which number is best tomorrow") - // <- keyword - // ^ punctuation.bracket - // ^ string - // ^ punctuation.bracket + // <- @keyword + // ^ @punctuation.bracket + // ^ @string + // ^ @punctuation.bracket } diff --git a/tests/query/highlights/gleam/type.gleam b/tests/query/highlights/gleam/type.gleam index b44aceadc..0905e1ea4 100644 --- a/tests/query/highlights/gleam/type.gleam +++ b/tests/query/highlights/gleam/type.gleam @@ -1,84 +1,84 @@ pub type Cat { -// <- type.qualifier -// ^^^^ keyword -// ^^^ type -// ^ punctuation.bracket +// <- @type.qualifier +// ^^^^ @keyword +// ^^^ @type +// ^ @punctuation.bracket Cat(name: String, cuteness: Int) - // <- constructor - // ^ punctuation.bracket - // ^^^^ property - // ^ punctuation.delimiter - // ^^^^^^ type.builtin - // ^ punctuation.delimiter - // ^^^^^^^^ property - // ^ punctuation.delimiter - // ^^^ type.builtin - // ^ punctuation.bracket + // <- @constructor + // ^ @punctuation.bracket + // ^^^^ @property + // ^ @punctuation.delimiter + // ^^^^^^ @type.builtin + // ^ @punctuation.delimiter + // ^^^^^^^^ @property + // ^ @punctuation.delimiter + // ^^^ @type.builtin + // ^ @punctuation.bracket } fn cats() { Cat(name: "Nubi", cuteness: 2001) - // <- type - // ^ punctuation.bracket - // ^^^^ property - // ^ punctuation.delimiter - // ^^^^^^ string - // ^ punctuation.delimiter - // ^^^^^^^^ property - // ^ punctuation.delimiter - // ^^^^ number - // ^ punctuation.bracket + // <- @type + // ^ @punctuation.bracket + // ^^^^ @property + // ^ @punctuation.delimiter + // ^^^^^^ @string + // ^ @punctuation.delimiter + // ^^^^^^^^ @property + // ^ @punctuation.delimiter + // ^^^^ @number + // ^ @punctuation.bracket Cat("Ginny", 1950) - // <- constructor - // ^ punctuation.bracket - // ^^^^^^^ string - // ^ punctuation.delimiter - // ^^^^ number - // ^ punctuation.bracket + // <- @constructor + // ^ @punctuation.bracket + // ^^^^^^^ @string + // ^ @punctuation.delimiter + // ^^^^ @number + // ^ @punctuation.bracket } type Box(inner_type) { -// <- keyword -// ^^^ type -// ^ punctuation.bracket -// ^^^^^^^^^^ type -// ^ punctuation.bracket -// ^ punctuation.bracket +// <- @keyword +// ^^^ @type +// ^ @punctuation.bracket +// ^^^^^^^^^^ @type +// ^ @punctuation.bracket +// ^ @punctuation.bracket Box(inner: inner_type) - // <- constructor - // ^ punctuation.bracket - // ^^^^^ property - // ^ punctuation.delimiter - // ^^^^^^^^^^ type - // ^ punctuation.bracket + // <- @constructor + // ^ @punctuation.bracket + // ^^^^^ @property + // ^ @punctuation.delimiter + // ^^^^^^^^^^ @type + // ^ @punctuation.bracket } pub opaque type Counter { -// <- type.qualifier -// ^^^^^^ type.qualifier -// ^^^^ keyword -// ^^^^^^^ type -// ^ punctuation.bracket +// <- @type.qualifier +// ^^^^^^ @type.qualifier +// ^^^^ @keyword +// ^^^^^^^ @type +// ^ @punctuation.bracket Counter(value: Int) } pub fn have_birthday(person) { Person(..person, age: person.age + 1, is_happy: True) - // <- constructor - // ^ punctuation.bracket - // ^^ operator - // ^^^^^^ variable - // ^ punctuation.delimiter - // ^^^ property - // ^ punctuation.delimiter - // ^^^^^^ variable - // ^ punctuation.delimiter - // ^^^ property - // ^ operator - // ^ number - // ^ punctuation.delimiter - // ^^^^^^^^ property - // ^ punctuation.delimiter - // ^^^^ boolean - // ^ punctuation.bracket + // <- @constructor + // ^ @punctuation.bracket + // ^^ @operator + // ^^^^^^ @variable + // ^ @punctuation.delimiter + // ^^^ @property + // ^ @punctuation.delimiter + // ^^^^^^ @variable + // ^ @punctuation.delimiter + // ^^^ @property + // ^ @operator + // ^ @number + // ^ @punctuation.delimiter + // ^^^^^^^^ @property + // ^ @punctuation.delimiter + // ^^^^ @boolean + // ^ @punctuation.bracket } diff --git a/tests/query/highlights/hack/as-foreach.hack b/tests/query/highlights/hack/as-foreach.hack index 8969be8fc..d7a66875b 100644 --- a/tests/query/highlights/hack/as-foreach.hack +++ b/tests/query/highlights/hack/as-foreach.hack @@ -1,6 +1,6 @@ foreach (($array as vec[]) as $item) {} -// ^ repeat -// ^ type +// ^ @repeat +// ^ @type # Our expectation test for the code below intentionally includes an ERROR. foreach ($array as vec[] as $item) {} diff --git a/tests/query/highlights/hack/async-functions.hack b/tests/query/highlights/hack/async-functions.hack index 4488c992d..41779d76d 100644 --- a/tests/query/highlights/hack/async-functions.hack +++ b/tests/query/highlights/hack/async-functions.hack @@ -1,8 +1,8 @@ async function func0(): void {} -// ^ type.builtin +// ^ @type.builtin async function func1<T1 as int>() {} -// ^ type.builtin -// ^ keyword.operator +// ^ @type.builtin +// ^ @keyword.operator async ($x) ==> $x + 1; diff --git a/tests/query/highlights/hack/attribute-type.hack b/tests/query/highlights/hack/attribute-type.hack index 5ab9eaa4b..0bd12df8c 100644 --- a/tests/query/highlights/hack/attribute-type.hack +++ b/tests/query/highlights/hack/attribute-type.hack @@ -2,13 +2,13 @@ newtype T1 = ?shape( // TODO: ?operator (? not captureable at the moment) ?'int' => int -// ^ operator +// ^ @operator ); <<A3(1), A2(2,3,)>> -// ^ attribute +// ^ @attribute type T2 = (function(T1): string); -// ^ type +// ^ @type // TODO: keyword.function (currently not in AST) <<A4(1), A5, A6(1,3,4)>> diff --git a/tests/query/highlights/hack/generics.hack b/tests/query/highlights/hack/generics.hack index 9582240b9..66b008aa4 100644 --- a/tests/query/highlights/hack/generics.hack +++ b/tests/query/highlights/hack/generics.hack @@ -1,24 +1,24 @@ class Box<T> { - // ^ type - // ^ type + // ^ @type + // ^ @type protected T $data; - // ^ type.qualifier - // ^ type + // ^ @type.qualifier + // ^ @type public function __construct(T $data) { - // ^ type - // ^ parameter - // ^ keyword.function - // ^ type.qualifier - // ^ method + // ^ @type + // ^ @parameter + // ^ @keyword.function + // ^ @type.qualifier + // ^ @method $this->data = $data; } public function getData(): T { - // ^ method - // ^ type.qualifier + // ^ @method + // ^ @type.qualifier return $this->data; - // ^ operator - // ^ variable.builtin + // ^ @operator + // ^ @variable.builtin } } diff --git a/tests/query/highlights/hack/heredoc-dollar.hack b/tests/query/highlights/hack/heredoc-dollar.hack index 8034cc863..8ea247389 100644 --- a/tests/query/highlights/hack/heredoc-dollar.hack +++ b/tests/query/highlights/hack/heredoc-dollar.hack @@ -1,4 +1,4 @@ <<<EOT $('a') abc $(function{return;}) EOT; -// <- comment ^ comment +// <- @comment ^ @comment diff --git a/tests/query/highlights/hack/shapes.hack b/tests/query/highlights/hack/shapes.hack index 0f6ab3448..bc8732433 100644 --- a/tests/query/highlights/hack/shapes.hack +++ b/tests/query/highlights/hack/shapes.hack @@ -1,12 +1,12 @@ class C extends Superclass implements Iface { -// ^ keyword ^ keyword +// ^ @keyword ^ @keyword use Trait; - // < include + // <- @include const type X = shape( - // <- keyword ^ type.builtin + // <- @keyword ^ @type.builtin "a" => int, - // ^ string + // ^ @string "b" => string, - // ^ type.builtin + // ^ @type.builtin ); } diff --git a/tests/query/highlights/hack/use.hack b/tests/query/highlights/hack/use.hack index d7b7ce784..353838a18 100644 --- a/tests/query/highlights/hack/use.hack +++ b/tests/query/highlights/hack/use.hack @@ -1,28 +1,28 @@ use const Space\Const\C; -// ^ keyword -// ^ constant +// ^ @keyword +// ^ @constant use function Space\Func\F as E; -// ^ function -// ^ function +// ^ @function +// ^ @function use type Space\Type\T; -// ^ keyword +// ^ @keyword use namespace Space\Name\N as M; -// ^ keyword -// ^ namespace +// ^ @keyword +// ^ @namespace use namespace Space\Name2\N2, Space\Nothing\N3 as N8, type Space\Type2\N4,; -// ^ namespace -// ^ type +// ^ @namespace +// ^ @type use namespace Space\Name\N10\{A as A2, B\}; -// ^ namespace -// ^ namespace -// ^ namespace +// ^ @namespace +// ^ @namespace +// ^ @namespace use namespace Space\Name\{\C, Slash as Forward}; use \What\Is\This\{function A as A2, B, const H\S\L as stdlib, function F}; use type \{kind,}; use Q\B\{kind2,}; -// ^ namespace +// ^ @namespace use type Q\B\{kind3,}; -// <- include +// <- @include diff --git a/tests/query/highlights/hack/using.hack b/tests/query/highlights/hack/using.hack index 4452ea962..c3a7be153 100644 --- a/tests/query/highlights/hack/using.hack +++ b/tests/query/highlights/hack/using.hack @@ -1,3 +1,3 @@ using ($new = new Object(), $file = new File('using', '+using')) {} -// <- keyword -// ^ type +// <- @keyword +// ^ @type diff --git a/tests/query/highlights/hack/xhp.hack b/tests/query/highlights/hack/xhp.hack index 992296b97..57563a131 100644 --- a/tests/query/highlights/hack/xhp.hack +++ b/tests/query/highlights/hack/xhp.hack @@ -4,7 +4,7 @@ echo "<tt>Hello <strong>$user_name</tt></strong>"; // XHP: Typechecked, well-formed, and secure $user_name = 'Andrew'; $xhp = <tt>Hello <strong>{$user_name}</strong></tt>; -// ^ tag -// ^ tag -// ^ string +// ^ @tag +// ^ @tag +// ^ @string echo await $xhp->toStringAsync(); diff --git a/tests/query/highlights/hocon/test.conf b/tests/query/highlights/hocon/test.conf index 881417b67..acfe4f975 100644 --- a/tests/query/highlights/hocon/test.conf +++ b/tests/query/highlights/hocon/test.conf @@ -1,59 +1,59 @@ HOCON = Human-Optimized Config Object Notation -// ^field -// ^string -// ^string -// ^string -// ^string +// ^ @field +// ^ @string +// ^ @string +// ^ @string +// ^ @string "it's": "a JSON\nsuperset", -// ^string -// ^string.escape -// ^punctuation.delimiter +// ^ @string +// ^ @string.escape +// ^ @punctuation.delimiter features: [ -// ^operator -// ^punctuation.bracket +// ^ @operator +// ^ @punctuation.bracket less noisy / less pedantic syntax -// ^string +// ^ @string ability to refer to another part of the configuration import/include another configuration file into the current file a mapping to a flat properties list such as Java's system properties ability to get values from environment variables # ability to write comments -// ^comment -// ^comment +// ^@ comment +// ^ @comment // this is also a comment -// ^comment -// ^comment +// ^ @comment +// ^ @comment ] specs url: "https://github.com/lightbend/config/blob/master/HOCON.md" includes: { include required(file("~/prog/tree-sitter-hocon/grammar.js")) -// ^keyword -//^include -// ^punctuation.bracket -// ^punctuation.bracket +// ^ @keyword +//^ @include +// ^ @punctuation.bracket +// ^ @punctuation.bracket override = true -// ^boolean +// ^ @boolean } it's: ${it's}. A ${HOCON} -// ^punctuation.special -// ^punctuation.special -// ^punctuation.special -// ^string -// ^string -// ^punctuation.special -// ^punctuation.special +// ^ @punctuation.special +// ^ @punctuation.special +// ^ @punctuation.special +// ^ @string +// ^ @string +// ^ @punctuation.special +// ^ @punctuation.special this.is.a."long.key" = null, -// ^punctuation.delimiter -// ^punctuation.delimiter -// ^punctuation.delimiter -// ^constant.builtin +// ^ @punctuation.delimiter +// ^ @punctuation.delimiter +// ^ @punctuation.delimiter +// ^ @constant.builtin week = 7 days -// ^number -// ^keyword +// ^ @number +// ^ @keyword diff --git a/tests/query/highlights/julia/test.jl b/tests/query/highlights/julia/test.jl index 46fc313c0..065df5c9e 100644 --- a/tests/query/highlights/julia/test.jl +++ b/tests/query/highlights/julia/test.jl @@ -1,26 +1,26 @@ function load_data(::Symbol; ::Int) :: Tuple -# <- keyword.function -# ^ function -# ^ punctuation.bracket -# ^^ punctuation.delimiter -# ^ type.builtin -# ^ punctuation.delimiter -# ^^ punctuation.delimiter -# ^^^ type.builtin -# ^ punctuation.bracket -# ^^ punctuation.delimiter -# ^ type.builtin +# <- @keyword.function +# ^ @function +# ^ @punctuation.bracket +# ^^ @punctuation.delimiter +# ^ @type.builtin +# ^ @punctuation.delimiter +# ^^ @punctuation.delimiter +# ^^^ @type.builtin +# ^ @punctuation.bracket +# ^^ @punctuation.delimiter +# ^ @type.builtin dataset = CIFAR10(; Tx = Float32, split = split) -# ^^^^^^^ variable -# ^ operator -# ^ function.call -# ^ operator -# ^ type.builtin +# ^^^^^^^ @variable +# ^ @operator +# ^ @function.call +# ^ @operator +# ^ @type.builtin X = reshape(dataset.features[:, :, :, begin:n_obs], :, n_obs) # flattening the image pixels -# ^^^^^ variable.builtin +# ^^^^^ @variable.builtin y = categorical2onehot(dataset.targets[begin:n_obs], N_LABELS) -# ^^^^^ variable.builtin +# ^^^^^ @variable.builtin return X, y -# ^^^^^^ keyword.return +# ^^^^^^ @keyword.return end -# <- keyword.function +# <- @keyword.function diff --git a/tests/query/highlights/lua/test.lua b/tests/query/highlights/lua/test.lua index e8725b9fe..55818bb74 100644 --- a/tests/query/highlights/lua/test.lua +++ b/tests/query/highlights/lua/test.lua @@ -1,18 +1,18 @@ -- luacheck: ignore local a = { 1, 2, 3, 4, 5 } --- ^ number ^ punctuation.bracket --- ^ variable +-- ^ @number ^ @punctuation.bracket +-- ^ @variable local _ = next(a) --- ^ function.builtin --- ^ keyword +-- ^ @function.builtin +-- ^ @keyword _ = next(a) --- ^ function.builtin +-- ^ @function.builtin next(a) --- ^ function.builtin +-- ^ @function.builtin -- Checking for incorrect hlgroup of injected luap string.match(s, "\0%d[^\n]+") --- ^ !constant +-- ^ @!constant diff --git a/tests/query/highlights/markdown/test.md b/tests/query/highlights/markdown/test.md index 2d3734515..20953a863 100644 --- a/tests/query/highlights/markdown/test.md +++ b/tests/query/highlights/markdown/test.md @@ -1,28 +1,28 @@ # H1 -<!-- <- text.title.1.marker --> +<!-- <- @text.title.1.marker --> ## H2 -<!-- <- text.title.2.marker --> +<!-- <- @text.title.2.marker --> - Item 1 - Item 2 -<!-- <- punctuation.special --> +<!-- <- @punctuation.special --> 1. Item 1 2. Item 2 -<!-- <- punctuation.special --> +<!-- <- @punctuation.special --> ---- -<!-- ^ text.reference --> -<!-- ^ text.uri --> -<!-- ^ text.literal --> -<!--^ punctuation.special --> -<!-- ^ punctuation.bracket --> -<!-- ^ punctuation.bracket --> +<!-- ^ @text.reference --> +<!-- ^ @text.uri --> +<!-- ^ @text.literal --> +<!--^ @punctuation.special --> +<!-- ^ @punctuation.bracket --> +<!-- ^ @punctuation.bracket --> [link_text](#local_reference "link go brr...") -<!-- ^ text.reference --> -<!-- ^ text.uri --> -<!-- ^ text.literal --> -<!-- <- punctuation.bracket --> -<!-- ^ punctuation.bracket --> +<!-- ^ @text.reference --> +<!-- ^ @text.uri --> +<!-- ^ @text.literal --> +<!-- <- @punctuation.bracket --> +<!-- ^ @punctuation.bracket --> diff --git a/tests/query/highlights/pascal/test.pas b/tests/query/highlights/pascal/test.pas index f60e8b40b..3a6cc786a 100644 --- a/tests/query/highlights/pascal/test.pas +++ b/tests/query/highlights/pascal/test.pas @@ -1,39 +1,39 @@ program foobar; -// ^ keyword +// ^ @keyword var -// <- keyword +// <- @keyword foo: bar; -// ^ variable -// ^ type +// ^ @variable +// ^ @type foo: foo.bar<t>; -// ^ variable -// ^ type -// ^ type -// ^ type +// ^ @variable +// ^ @type +// ^ @type +// ^ @type begin -// ^ keyword +// ^ @keyword foo := bar; -// ^ variable -// ^ variable +// ^ @variable +// ^ @variable foo; -// ^ function +// ^ @function foo(); -// ^ function +// ^ @function foo(bar(xyz)); -// ^ function -// ^ function -// ^ variable +// ^ @function +// ^ @function +// ^ @variable xx + yy; -// ^ variable -// ^ variable +// ^ @variable +// ^ @variable xx := y + z + func(a, b, c); -// ^ variable -// ^ variable -// ^ variable -// ^ function -// ^ variable -// ^ variable -// ^ variable +// ^ @variable +// ^ @variable +// ^ @variable +// ^ @function +// ^ @variable +// ^ @variable +// ^ @variable end. -// <- keyword +// <- @keyword diff --git a/tests/query/highlights/python/pattern_matching.py b/tests/query/highlights/python/pattern_matching.py index 2d7d7d0c0..cd359a48f 100644 --- a/tests/query/highlights/python/pattern_matching.py +++ b/tests/query/highlights/python/pattern_matching.py @@ -1,51 +1,51 @@ match command.split(): -# ^ conditional +# ^ @conditional case ["quit"]: - # ^ conditional + # ^ @conditional print("Goodbye!") quit_game() case ["look"]: - # ^ conditional + # ^ @conditional current_room.describe() case ["get", obj]: - # ^ conditional + # ^ @conditional character.get(obj, current_room) case ["go", direction]: - # ^ conditional + # ^ @conditional current_room = current_room.neighbor(direction) # The rest of your commands go here match command.split(): -# ^ conditional +# ^ @conditional case ["drop", *objects]: - # ^ conditional + # ^ @conditional for obj in objects: character.drop(obj, current_room) match command.split(): -# ^ conditional +# ^ @conditional case ["quit"]: ... # Code omitted for brevity case ["go", direction]: pass case ["drop", *objects]: pass case _: print(f"Sorry, I couldn't understand {command!r}") - # ^^ @function.macro + # ^^ @@function.macro match command.split(): -# ^ conditional +# ^ @conditional case ["north"] | ["go", "north"]: - # ^ conditional + # ^ @conditional current_room = current_room.neighbor("north") case ["get", obj] | ["pick", "up", obj] | ["pick", obj, "up"]: - # ^ conditional + # ^ @conditional pass match = 2 -# ^ variable +# ^ @variable match, a = 2, 3 -# ^ variable +# ^ @variable match: int = secret -# ^ variable +# ^ @variable x, match: str = 2, "hey, what's up?" -# <- variable -# ^ variable +# <- @variable +# ^ @variable diff --git a/tests/query/highlights/rust/super-crate-imports.rs b/tests/query/highlights/rust/super-crate-imports.rs index 49a0c2918..59354a32c 100644 --- a/tests/query/highlights/rust/super-crate-imports.rs +++ b/tests/query/highlights/rust/super-crate-imports.rs @@ -1,12 +1,12 @@ use crate::a; -// ^ namespace +// ^ @namespace // ^ !keyword use crate::{b, c}; -// ^ namespace +// ^ @namespace // ^ !keyword use super::a; -// ^ namespace +// ^ @namespace // ^ !keyword use super::{b, c}; -// ^ namespace +// ^ @namespace // ^ !keyword diff --git a/tests/query/highlights/solidity/test.sol b/tests/query/highlights/solidity/test.sol index 062970fdd..99117bb55 100644 --- a/tests/query/highlights/solidity/test.sol +++ b/tests/query/highlights/solidity/test.sol @@ -1,27 +1,27 @@ // Example contract from official documentation at https://github.com/ethereum/solidity/blob/v0.8.12/docs/examples/voting.rst // SPDX-License-Identifier: GPL-3.0 -// ^ comment +// ^ @comment pragma solidity >=0.7.0 <0.9.0; -// ^ preproc -// ^ preproc +// ^ @preproc +// ^ @preproc import * as something from "anotherFile"; -// ^ ^ ^ include +// ^ ^ ^ @include /// @title Voting with delegation. -// <- comment +// <- @comment contract Ballot { // ^keyword -// ^ type +// ^ @type // This declares a new complex type which will // be used for variables later. // It will represent a single voter. struct Voter { -// ^ type +// ^ @type uint weight; // weight is accumulated by delegation -// ^ type.builtin -// ^ field +// ^ @type.builtin +// ^ @field bool voted; // if true, that person already voted address delegate; // person delegated to uint vote; // index of the voted proposal @@ -34,23 +34,23 @@ contract Ballot { } address public chairperson; -// ^ type.builtin +// ^ @type.builtin // This declares a state variable that // stores a `Voter` struct for each possible address. mapping(address => Voter) public voters; -// ^ ^ punctuation.bracket -// ^ punctuation.delimiter +// ^ ^ @punctuation.bracket +// ^ @punctuation.delimiter // A dynamically-sized array of `Proposal` structs. Proposal[] public proposals; enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill } -// ^ constant +// ^ @constant /// Create a new ballot to choose one of `proposalNames`. constructor(bytes32[] memory proposalNames) { -// ^ constructor +// ^ @constructor chairperson = msg.sender; voters[chairperson].weight = 1; @@ -63,7 +63,7 @@ contract Ballot { // appends it to the end of `proposals`. proposals.push(Proposal({ name: proposalNames[i], -// ^ field +// ^ @field voteCount: 0 })); } @@ -72,9 +72,9 @@ contract Ballot { // Give `voter` the right to vote on this ballot. // May only be called by `chairperson`. function giveRightToVote(address voter) external { -// ^ keyword.function -// ^ function -// ^ parameter +// ^ @keyword.function +// ^ @function +// ^ @parameter // If the first argument of `require` evaluates // to `false`, execution terminates and all // changes to the state and to Ether balances @@ -180,7 +180,7 @@ contract Ballot { contract Another { Ballot b = new Ballot(new bytes32[](1)); -// ^ keyword.operator +// ^ @keyword.operator } // vim:ft=solidity diff --git a/tests/query/highlights/t32/comments.cmm b/tests/query/highlights/t32/comments.cmm index 0bab130f6..e36f7e63a 100644 --- a/tests/query/highlights/t32/comments.cmm +++ b/tests/query/highlights/t32/comments.cmm @@ -1,10 +1,10 @@ // This is a comment -; <- comment +; <- @comment ; Another comment -; <- comment +; <- @comment ECHO &a // This is a trailing comment -; ^ comment +; ^ @comment // vim: set ft=t32: diff --git a/tests/query/highlights/t32/keywords.cmm b/tests/query/highlights/t32/keywords.cmm index 21422438b..a4013d72f 100644 --- a/tests/query/highlights/t32/keywords.cmm +++ b/tests/query/highlights/t32/keywords.cmm @@ -1,123 +1,123 @@ PRIVATE &password -; <- keyword -; ^ variable.builtin +; <- @keyword +; ^ @variable.builtin ENTRY &password -; <- keyword -; ^ parameter +; <- @keyword +; ^ @parameter ENTRY %LINE &salt -; <- keyword -; ^ constant.builtin -; ^ parameter +; <- @keyword +; ^ @constant.builtin +; ^ @parameter IF "&password"=="" -; <- conditional -; ^ string -; ^ variable.builtin -; ^ operator +; <- @conditional +; ^ @string +; ^ @variable.builtin +; ^ @operator ( ECHO "Failed to provide password." ENDDO -; ^ keyword.return +; ^ @keyword.return ) ELSE -; <- conditional +; <- @conditional ( PRIVATE &pass &pass=FALSE() -; ^ function.builtin +; ^ @function.builtin WHILE !&pass -; ^ operator +; ^ @operator ( GOSUB verify_password "&password" -; ^ function.call +; ^ @function.call RETURNVALUES &pass -; ^ parameter +; ^ @parameter WAIT 10.ms -; ^ float +; ^ @float ) IF !&pass GOTO fail -; ^ label +; ^ @label ELSE ( GOSUB start_debug -; ^ function.call +; ^ @function.call ) ) LOCAL &num -; ^ variable.builtin +; ^ @variable.builtin &num = 2. -; ^ number +; ^ @number RePeaT &num PRINT "Password: &password" -; ^ variable.builtin -; ^ variable.builtin +; ^ @variable.builtin +; ^ @variable.builtin WinCLEAR FramePOS ,,,,Maximized -; ^ punctuation.delimiter -; ^ constant.builtin +; ^ @punctuation.delimiter +; ^ @constant.builtin WinPOS 0% 50% 100% 35% -; ^ float +; ^ @float COVerage.ListFunc ENDDO fail: -; <- label +; <- @label PRINT %ERROR "Password verification failed." END -; ^ keyword.return +; ^ @keyword.return verify_password: -; <- function +; <- @function ( PARAMETERS &password -; ^ parameter +; ^ @parameter SYStem.Option.KEYCODE "&password" SYStem.JtagClock 1kHz -; ^ float +; ^ @float SYStem.Mode.Attach Data.Set N: EAXI:0x34000000 %Long 0x34000100 0x34000021 /verify -; ^ constant.builtin -; ^ constant.builtin -; ^ number -; ^ constant.builtin -; ^ number -; ^ constant.builtin +; ^ @constant.builtin +; ^ @constant.builtin +; ^ @number +; ^ @constant.builtin +; ^ @number +; ^ @constant.builtin RETURN TRUE() -; ^ keyword.return +; ^ @keyword.return ) SUBROUTINE start_debug -; <- keyword.function -; ^ function +; <- @keyword.function +; ^ @function ( COVerage.ListModule %MULTI.OBC \sieve -; ^ keyword -; ^ constant.builtin -; ^ symbol +; ^ @keyword +; ^ @constant.builtin +; ^ @symbol Var.DRAW flags[0..16] /Alternate 3 -; ^ keyword -; ^ variable -; ^ constant.builtin -; ^ number +; ^ @keyword +; ^ @variable +; ^ @constant.builtin +; ^ @number Go main RETURN -; ^ keyword.return +; ^ @keyword.return ) // vim: set ft=t32: diff --git a/tests/query/highlights/t32/literals.cmm b/tests/query/highlights/t32/literals.cmm index 6c6849aea..8c63ce96d 100644 --- a/tests/query/highlights/t32/literals.cmm +++ b/tests/query/highlights/t32/literals.cmm @@ -1,39 +1,39 @@ WinPOS ,,1000.,,,,myWatchWindow -; ^ number +; ^ @number PRinTer.OPEN "~~~/varwatch.txt" ASCIIE -; ^ string +; ^ @string sYmbol.NEW _InitialSP 0x34000100 -; ^ number +; ^ @number DO ~~~~/test.cmm -; ^ string.special +; ^ @string.special WAIT 1.ns -; ^ float +; ^ @float SYStem.JtagClock 100.GHZ -; ^ float +; ^ @float DATA.SET P:&HEAD+0x4 %LONG DATA.LONG(EA:&HEAD+0x4)&0xFFFFFF -; ^ constant.builtin +; ^ @constant.builtin List `main` -; ^ symbol +; ^ @symbol &range = 'a'--'z'||'0'--'9' -; ^ character -; ^ operator -; ^ character +; ^ @character +; ^ @operator +; ^ @character Data.Set N: 0xffff800000 0y0011xx01xx&&a -; ^ constant.builtin -; ^ number -; ^ number -; ^ operator +; ^ @constant.builtin +; ^ @number +; ^ @number +; ^ @operator WinPOS 0% 85% 100% 15% -; ^ float +; ^ @float // vim: set ft=t32: diff --git a/tests/query/highlights/t32/var.cmm b/tests/query/highlights/t32/var.cmm index d77de90c8..de67278a0 100644 --- a/tests/query/highlights/t32/var.cmm +++ b/tests/query/highlights/t32/var.cmm @@ -1,7 +1,7 @@ Var.NEWGLOBAL char[4][32] \myarr -; <- keyword -; ^ type.builtin -; ^ variable.builtin +; <- @keyword +; ^ @type.builtin +; ^ @variable.builtin LOCAL &i &data &data="zero|one|two|three" @@ -12,64 +12,64 @@ WHILE &i<4 PRIVATE &val &val=STRing.SPLIT("&data","|",&i) Var.Assign \myarr[&i]="&val" -; ^ variable.builtin -; ^ operator +; ^ @variable.builtin +; ^ @operator &i=&i+1. ) Var.NEWLOCAL \x -; <- keyword -; ^ variable.builtin +; <- @keyword +; ^ @variable.builtin Var.set \x=func3(5,3) -; ^ variable.builtin -; ^ function.call -; ^ number +; ^ @variable.builtin +; ^ @function.call +; ^ @number PRINT Var.VALUE(\x) -; ^ variable.builtin +; ^ @variable.builtin PRINT Var.VALUE('a') -; ^ character +; ^ @character Var.Assign (*ap)[2..4] = &a -; ^ variable -; ^ variable +; ^ @variable +; ^ @variable Var.Assign sp = &s.n+offset -; ^ variable -; ^ variable -; ^ field -; ^ variable +; ^ @variable +; ^ @variable +; ^ @field +; ^ @variable Var.Assign padd = (CAddition const * volatile)&d -; ^ variable -; ^ type -; ^ type.qualifier -; ^ type.qualifier -; ^ variable +; ^ @variable +; ^ @type +; ^ @type.qualifier +; ^ @type.qualifier +; ^ @variable Var.Assign e1 = (enum e2)&e -; ^ variable -; ^ keyword -; ^ type -; ^ variable +; ^ @variable +; ^ @keyword +; ^ @type +; ^ @variable Var.Assign *vector = (struct Vector3d*)&acceleration -; ^ variable -; ^ keyword -; ^ type -; ^ variable +; ^ @variable +; ^ @keyword +; ^ @type +; ^ @variable Var.Assign z = (union foo)x -; ^ variable -; ^ keyword -; ^ type -; ^ variable +; ^ @variable +; ^ @keyword +; ^ @type +; ^ @variable Var.Assign b = -a -; ^ variable -; ^ variable +; ^ @variable +; ^ @variable Var.Assign c = i++ -; ^ variable -; ^ variable +; ^ @variable +; ^ @variable Var.Assign d = sizeof(int) -; ^ variable -; ^ keyword.operator -; ^ type.builtin +; ^ @variable +; ^ @keyword.operator +; ^ @type.builtin Var.call strcmp(key,buffer) -; ^ function.call -; ^ variable -; ^ variable +; ^ @function.call +; ^ @variable +; ^ @variable // vim: set ft=t32: diff --git a/tests/query/highlights/tiger/built-ins.tig b/tests/query/highlights/tiger/built-ins.tig index 7cc1ca501..9aa649421 100644 --- a/tests/query/highlights/tiger/built-ins.tig +++ b/tests/query/highlights/tiger/built-ins.tig @@ -1,21 +1,21 @@ let var a := exit(0) - /* ^ function.builtin */ + /* ^ @function.builtin */ primitive exit(ret: int) /* Shadowing the prelude-included built-in */ - /* ^ type.builtin */ + /* ^ @type.builtin */ var b := exit(0) - /* ^ function.builtin */ + /* ^ @function.builtin */ type int = string /* Shadowing the built-in type */ - /* ^ type.builtin */ + /* ^ @type.builtin */ var c : int := "This is an \"int\"" - /* ^ type.builtin (not sure why it isn't 'type')*/ + /* ^ @type.builtin (not sure why it isn't 'type')*/ var d : Object := nil - /* ^ type.builtin */ + /* ^ @type.builtin */ type Object = int @@ -23,22 +23,22 @@ let in let var c : int := "This is an int" - /* ^ type.builtin (not sure why it isn't 'type')*/ + /* ^ @type.builtin (not sure why it isn't 'type')*/ var d : Object := "This is an object" - /* ^ type.builtin (not sure why it isn't 'type')*/ + /* ^ @type.builtin (not sure why it isn't 'type')*/ in end; exit(1); - /* <- function.builtin */ + /* <- @function.builtin */ print("shadowing is fun"); - /* <- function.builtin */ + /* <- @function.builtin */ self; - /* <- variable.builtin */ + /* <- @variable.builtin */ b := print - /* ^ variable */ + /* ^ @variable */ end /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/tiger/comment.tig b/tests/query/highlights/tiger/comment.tig index a9c91535f..9323dba05 100644 --- a/tests/query/highlights/tiger/comment.tig +++ b/tests/query/highlights/tiger/comment.tig @@ -1,6 +1,6 @@ /* This is /* a nested */ comment */ -/* <- comment - ^ comment - ^ comment +/* <- @comment + ^ @comment + ^ @comment */ /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/tiger/functions.tig b/tests/query/highlights/tiger/functions.tig index 219c05916..6505d20fe 100644 --- a/tests/query/highlights/tiger/functions.tig +++ b/tests/query/highlights/tiger/functions.tig @@ -1,9 +1,9 @@ primitive print(s: string) -/* ^ function */ -/* ^ parameter */ +/* ^ @function */ +/* ^ @parameter */ function func(a: int) : int = (print("Hello World!"); a) -/* ^ function */ -/* ^ parameter */ -/* ^ function.builtin */ +/* ^ @function */ +/* ^ @parameter */ +/* ^ @function.builtin */ /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/tiger/identifiers.tig b/tests/query/highlights/tiger/identifiers.tig index 4216c930d..e712e57de 100644 --- a/tests/query/highlights/tiger/identifiers.tig +++ b/tests/query/highlights/tiger/identifiers.tig @@ -1,30 +1,30 @@ type int = int -/* ^ variable */ -/* ^ type.builtin */ +/* ^ @variable */ +/* ^ @type.builtin */ type int_array = array of int -/* ^ type.builtin */ +/* ^ @type.builtin */ type record = {a: int, b: string} -/* ^ property */ -/* ^ type.builtin */ -/* ^ property */ -/* ^ type.builtin */ +/* ^ @property */ +/* ^ @type.builtin */ +/* ^ @property */ +/* ^ @type.builtin */ var record := record {a = 12, b = "27"} -/* ^ variable */ -/* ^ type */ -/* ^ property */ -/* ^ property */ +/* ^ @variable */ +/* ^ @type */ +/* ^ @property */ +/* ^ @property */ var array := int_array[12] of 27; -/* ^ variable */ -/* ^ type */ +/* ^ @variable */ +/* ^ @type */ primitive func(a: int, b: string) : array -/* ^ parameter */ -/* ^ type.builtin */ -/* ^ parameter */ -/* ^ type.builtin */ -/* ^ type */ +/* ^ @parameter */ +/* ^ @type.builtin */ +/* ^ @parameter */ +/* ^ @type.builtin */ +/* ^ @type */ /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/tiger/imports.tig b/tests/query/highlights/tiger/imports.tig index 068dc4810..f20a0bc1a 100644 --- a/tests/query/highlights/tiger/imports.tig +++ b/tests/query/highlights/tiger/imports.tig @@ -1,4 +1,4 @@ import "lib.tih" -/* <- include */ -/* ^ string.special */ +/* <- @include */ +/* ^ @string.special */ /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/tiger/keywords.tig b/tests/query/highlights/tiger/keywords.tig index 862a531cd..7deb0288d 100644 --- a/tests/query/highlights/tiger/keywords.tig +++ b/tests/query/highlights/tiger/keywords.tig @@ -1,42 +1,42 @@ let -/* <- keyword */ +/* <- @keyword */ var a := 12 - /* <- keyword */ + /* <- @keyword */ function f() : int = a - /* <- keyword.function */ + /* <- @keyword.function */ primitive g() - /* <- keyword.function */ + /* <- @keyword.function */ import "lib.tih" - /* <- include */ + /* <- @include */ type array_of_int = array of int - /* <- keyword */ - /* ^ keyword */ - /* ^ keyword */ + /* <- @keyword */ + /* ^ @keyword */ + /* ^ @keyword */ in -/* <- keyword */ +/* <- @keyword */ 12; if 12 then 27 else 42; - /* <- keyword */ - /* ^ keyword */ - /* ^ keyword */ + /* <- @keyword */ + /* ^ @keyword */ + /* ^ @keyword */ for i := 12 to 27 do 42; - /* <- repeat */ - /* ^ repeat */ - /* ^ repeat */ + /* <- @repeat */ + /* ^ @repeat */ + /* ^ @repeat */ while 12 do break - /* <- repeat */ - /* ^ repeat */ - /* ^ keyword */ + /* <- @repeat */ + /* ^ @repeat */ + /* ^ @keyword */ end -/* <- keyword */ +/* <- @keyword */ /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/tiger/literals.tig b/tests/query/highlights/tiger/literals.tig index c7d7b5d8e..46f3c8616 100644 --- a/tests/query/highlights/tiger/literals.tig +++ b/tests/query/highlights/tiger/literals.tig @@ -1,9 +1,9 @@ nil -/* <- constant.builtin */ +/* <- @constant.builtin */ 42 -/* <- number */ +/* <- @number */ "Hello World!\n" -/* <- string - ^ string.escape +/* <- @string + ^ @string.escape */ /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/tiger/meta-variables.tig b/tests/query/highlights/tiger/meta-variables.tig index 24c01ac69..1b2c6c976 100644 --- a/tests/query/highlights/tiger/meta-variables.tig +++ b/tests/query/highlights/tiger/meta-variables.tig @@ -1,14 +1,14 @@ let _chunks(42) - /* <- keyword */ + /* <- @keyword */ in _lvalue(12) : _namety(42) := _cast("I'm So Meta Even This Acronym", string); - /* <- keyword */ - /* ^ keyword */ - /* ^ keyword */ + /* <- @keyword */ + /* ^ @keyword */ + /* ^ @keyword */ _exp(42) - /* <- keyword */ + /* <- @keyword */ end /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/tiger/object-oriented.tig b/tests/query/highlights/tiger/object-oriented.tig index b09b82b19..607efec8c 100644 --- a/tests/query/highlights/tiger/object-oriented.tig +++ b/tests/query/highlights/tiger/object-oriented.tig @@ -1,29 +1,29 @@ let class A extends Object {} - /* <- keyword */ - /* ^ keyword */ - /* ^ type.builtin */ + /* <- @keyword */ + /* ^ @keyword */ + /* ^ @type.builtin */ type B = class extends A { - /* ^ keyword */ - /* ^ keyword */ - /* ^ type */ + /* ^ @keyword */ + /* ^ @keyword */ + /* ^ @type */ var a := 12 method meth() : int = self.a - /* <- keyword.function */ - /* ^ method */ - /* ^ variable.builtin */ + /* <- @keyword.function */ + /* ^ @method */ + /* ^ @variable.builtin */ } var object := new B - /* ^ keyword.operator */ + /* ^ @keyword.operator */ in object.a := 27; - /* ^ property */ + /* ^ @property */ object.meth() - /* ^ method */ + /* ^ @method */ end /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/tiger/operators.tig b/tests/query/highlights/tiger/operators.tig index 569b8a8bc..d803af75b 100644 --- a/tests/query/highlights/tiger/operators.tig +++ b/tests/query/highlights/tiger/operators.tig @@ -1,49 +1,49 @@ let var a : int := 42 - /* ^ punctuation.delimiter */ - /* ^ operator */ + /* ^ @punctuation.delimiter */ + /* ^ @operator */ in ( - /* <- punctuation.bracket */ + /* <- @punctuation.bracket */ -1 | 2 & 3 + 4 * 5; - /* <- operator */ - /* ^ operator */ - /* ^ operator */ - /* ^ operator */ - /* ^ operator */ - /* ^ punctuation.delimiter */ + /* <- @operator */ + /* ^ @operator */ + /* ^ @operator */ + /* ^ @operator */ + /* ^ @operator */ + /* ^ @punctuation.delimiter */ 12 >= 27; - /* ^ operator */ + /* ^ @operator */ 12 <= 27; - /* ^ operator */ + /* ^ @operator */ 12 = 27; - /* ^ operator */ + /* ^ @operator */ 12 <> 27; - /* ^ operator */ + /* ^ @operator */ 12 < 27; - /* ^ operator */ + /* ^ @operator */ 12 > 27; - /* ^ operator */ + /* ^ @operator */ record.field; - /* ^ punctuation.delimiter */ + /* ^ @punctuation.delimiter */ func(a, b); - /* ^ punctuation.bracket */ - /* ^ punctuation.bracket */ - /* ^ punctuation.delimiter */ + /* ^ @punctuation.bracket */ + /* ^ @punctuation.bracket */ + /* ^ @punctuation.delimiter */ record_type { }; - /* ^ punctuation.bracket */ - /* ^ punctuation.bracket */ + /* ^ @punctuation.bracket */ + /* ^ @punctuation.bracket */ array[42] - /* ^ punctuation.bracket */ - /* ^ punctuation.bracket */ + /* ^ @punctuation.bracket */ + /* ^ @punctuation.bracket */ ) - /* <- punctuation.bracket */ + /* <- @punctuation.bracket */ end /* vim: set ft=tiger: */ diff --git a/tests/query/highlights/typescript/as.ts b/tests/query/highlights/typescript/as.ts index ef0ce98e5..71221f410 100644 --- a/tests/query/highlights/typescript/as.ts +++ b/tests/query/highlights/typescript/as.ts @@ -1,8 +1,8 @@ import * as foo from 'foo'; -// ^ include +// ^ @include export { foo as bar }; -// ^ include +// ^ @include const n = 5 as number; -// ^ keyword.operator +// ^ @keyword.operator diff --git a/tests/query/highlights/usd/prims.usda b/tests/query/highlights/usd/prims.usda index eeac67d74..eeeeae920 100644 --- a/tests/query/highlights/usd/prims.usda +++ b/tests/query/highlights/usd/prims.usda @@ -1,11 +1,11 @@ def Xform "cube" ( assetInfo = { - # <- keyword + # <- @keyword asset[] payloadAssetDependencies = [@fizz.usd@, @buzz.usd@] - # <- type - # ^ keyword - # ^ text.uri - # ^ text.uri + # <- @type + # ^ @keyword + # ^ @text.uri + # ^ @text.uri } ) { @@ -13,13 +13,13 @@ def Xform "cube" ( def "root" ( add references = @foo.usda@</Model> (offset = 1; scale = 2.0) - # <- text.uri - # ^ string.special - # ^ keyword - # ^ number - # ^ punctuation.delimiter - # ^ keyword - # ^ float + # <- @text.uri + # ^ @string.special + # ^ @keyword + # ^ @number + # ^ @punctuation.delimiter + # ^ @keyword + # ^ @float ) { } @@ -28,14 +28,14 @@ def "World" { over "points" ( clips = { - # <- keyword + # <- @keyword dictionary default = { - # <- type - # ^ variable + # <- @type + # ^ @variable double2[] times = [(101, 101), (102, 102)] - # <- type - # ^ keyword - # ^ number + # <- @type + # ^ @keyword + # ^ @number } } ) @@ -49,9 +49,9 @@ def Xform "torch_2" ( ) { // Pre-published light list - # <- comment + # <- @comment rel lightList = [ <light> ] # inline comment - # ^ comment + # ^ @comment token lightList:cacheBehavior = "consumeAndContinue" double3 xformOp:translate = (1, 0, 0.5) @@ -60,7 +60,7 @@ def Xform "torch_2" ( def "foo" ( "some comment" - # <- comment.documentation + # <- @comment.documentation ) { } @@ -68,20 +68,20 @@ def "foo" ( def "foo" ( # inline comment "actual in-description comment" - # <- comment.documentation + # <- @comment.documentation ) { } def "foo" ( add references = @foo.usda@ - # <- function.call + # <- @function.call append references = @foo.usda@ - # <- function.call + # <- @function.call delete references = @foo.usda@ - # <- function.call + # <- @function.call reorder references = [@foo.usda@] - # <- function.call + # <- @function.call references = [@foo.usda@] # explicit ) @@ -90,11 +90,11 @@ def "foo" ( over "Parent" ( prepend references = [</InternalRef>, @./ref.usda@</RefParent>] - # <- function.call - # ^ keyword - # ^ string.special - # ^ text.uri - # ^ string.special + # <- @function.call + # ^ @keyword + # ^ @string.special + # ^ @text.uri + # ^ @string.special ) { } @@ -102,17 +102,17 @@ over "Parent" ( def "foo" { float value.timeSamples = { - # <- type - # ^ variable - # ^ property + # <- @type + # ^ @variable + # ^ @property -414: 14.4 - # <- number - # ^ float + # <- @number + # ^ @float 10: 201.0, - # <- number - # ^ float + # <- @number + # ^ @float 10.123: 201.0123, - # <- float - # ^ float + # <- @float + # ^ @float } } diff --git a/tests/query/highlights/usd/properties.usda b/tests/query/highlights/usd/properties.usda index 67df8a623..e518c73f7 100644 --- a/tests/query/highlights/usd/properties.usda +++ b/tests/query/highlights/usd/properties.usda @@ -1,21 +1,21 @@ dictionary foo = {} -# <- type +# <- @type half[] foo = [2, 1, 2] -# <- type +# <- @type string foo = "something" -# <- type +# <- @type timecode time = 1.0 -# <- type +# <- @type token[] purpose = ["default", "render"] -# <- type +# <- @type rel material:binding:collection:Erasers = None -# <- type -# ^ namespace -# ^ punctuation.delimiter -# ^ namespace -# ^ punctuation.delimiter -# ^ namespace -# ^ punctuation.delimiter -# ^ variable -# ^ constant.builtin +# <- @type +# ^ @namespace +# ^ @punctuation.delimiter +# ^ @namespace +# ^ @punctuation.delimiter +# ^ @namespace +# ^ @punctuation.delimiter +# ^ @variable +# ^ @constant.builtin diff --git a/tests/query/highlights/usd/subLayers.usda b/tests/query/highlights/usd/subLayers.usda index b4dfa6298..24581b90a 100644 --- a/tests/query/highlights/usd/subLayers.usda +++ b/tests/query/highlights/usd/subLayers.usda @@ -1,9 +1,9 @@ #usda 1.0 ( subLayers = [ - # <- keyword + # <- @keyword @./model_sub.usda@ (offset = 1) - # <- text.uri - # ^ keyword + # <- @text.uri + # ^ @keyword ] ) diff --git a/tests/query/highlights/wing/class.w b/tests/query/highlights/wing/class.w index 06160d741..b102db891 100644 --- a/tests/query/highlights/wing/class.w +++ b/tests/query/highlights/wing/class.w @@ -1,19 +1,19 @@ bring cloud; -// <- keyword +// <- @keyword class Foo { -// <- keyword -// ^ variable -// ^ punctuation.bracket +// <- @keyword +// ^ @variable +// ^ @punctuation.bracket name: str; -//^ field -// ^ type.builtin -// ^ punctuation.delimiter +//^ @field +// ^ @type.builtin +// ^ @punctuation.delimiter new(name: str) { -//^ keyword -// ^ variable +//^ @keyword +// ^ @variable this.name = name; -// ^ punctuation.delimiter -// ^ operator +// ^ @punctuation.delimiter +// ^ @operator } } diff --git a/tests/query/highlights/wing/nested_method.w b/tests/query/highlights/wing/nested_method.w index 04fd1a37d..8a454b34c 100644 --- a/tests/query/highlights/wing/nested_method.w +++ b/tests/query/highlights/wing/nested_method.w @@ -1,4 +1,4 @@ test1.test2.test3(); -// <- variable -// ^ property -// ^ method.call +// <- @variable +// ^ @property +// ^ @method.call diff --git a/tests/query/highlights/xhp-intro.hack b/tests/query/highlights/xhp-intro.hack index 942d2ff00..ccbe60c57 100644 --- a/tests/query/highlights/xhp-intro.hack +++ b/tests/query/highlights/xhp-intro.hack @@ -5,23 +5,23 @@ use type Facebook\XHP\HTML\{XHPHTMLHelpers, a, form}; final xhp class a_post extends x\element { -// ^ type.qualifier -// ^ type.qualifier -// ^ keyword +// ^ @type.qualifier +// ^ @type.qualifier +// ^ @keyword use XHPHTMLHelpers; attribute string href @required; - // ^ attribute + // ^ @attribute attribute string target; - // ^ keyword + // ^ @keyword <<__Override>> protected async function renderAsync(): Awaitable<x\node> { $id = $this->getID(); $anchor = <a>{$this->getChildren()}</a>; - // ^ tag.delimiter - // ^ tag + // ^ @tag.delimiter + // ^ @tag $form = ( <form id={$id} @@ -38,7 +38,7 @@ final xhp class a_post extends x\element { 'document.getElementById("'.$id.'").submit(); return false;', ); $anchor->setAttribute('href', '#'); - // ^ method.call + // ^ @method.call return $form; } diff --git a/tests/query/injections/cuda/macro-self-injection.cu b/tests/query/injections/cuda/macro-self-injection.cu index 1acef197b..a91184287 100644 --- a/tests/query/injections/cuda/macro-self-injection.cu +++ b/tests/query/injections/cuda/macro-self-injection.cu @@ -1,2 +1,2 @@ #define FOO(X,Y) X + Y -// ^ cuda +// ^ @cuda diff --git a/tests/query/injections/dockerfile/bash-on-run-instructions.dockerfile b/tests/query/injections/dockerfile/bash-on-run-instructions.dockerfile index d25020494..00621f1a3 100644 --- a/tests/query/injections/dockerfile/bash-on-run-instructions.dockerfile +++ b/tests/query/injections/dockerfile/bash-on-run-instructions.dockerfile @@ -1,6 +1,6 @@ FROM foo RUN bar -# ^ bash +# ^ @bash RUN \ baz -# ^ bash +# ^ @bash diff --git a/tests/query/injections/ecma/ecma-test-injections.js b/tests/query/injections/ecma/ecma-test-injections.js index 68d53721a..16ddd3c6b 100644 --- a/tests/query/injections/ecma/ecma-test-injections.js +++ b/tests/query/injections/ecma/ecma-test-injections.js @@ -1,9 +1,9 @@ html`<p></p>`; - // ^ html + // ^ @html html(`<p></p>`); - // ^ html + // ^ @html svg`<p></p>`; - // ^ html + // ^ @html svg(`<p></p>`); - // ^ html + // ^ @html diff --git a/tests/query/injections/html/test-html-injections.html b/tests/query/injections/html/test-html-injections.html index 954ce5623..0df3bd420 100644 --- a/tests/query/injections/html/test-html-injections.html +++ b/tests/query/injections/html/test-html-injections.html @@ -6,50 +6,50 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="css/style.css" rel="stylesheet"> <style> footer{ } </style> - <!-- ^ css --> + <!-- ^ @css --> <style title="Test Style without type attribute"> footer{ } </style> - <!-- ^ css --> + <!-- ^ @css --> <style type="text/css" title="test style with defined type attribute"> footer{ } </style> - <!-- ^ css --> + <!-- ^ @css --> </head> <body> <script> const x = 1 </script> - <!-- ^ javascript --> + <!-- ^ @javascript --> <script defer> const x = 1 </script> - <!-- ^ javascript --> + <!-- ^ @javascript --> <script async defer> const x = 1 </script> - <!-- ^ javascript --> + <!-- ^ @javascript --> <script type="text/javascript"> const x = 1 </script> - <!-- ^ javascript --> + <!-- ^ @javascript --> <script type="text/ecmascript"> const x = 1 </script> - <!-- ^ javascript --> + <!-- ^ @javascript --> <script type="application/ecmascript"> const x = 1 </script> - <!-- ^ javascript --> + <!-- ^ @javascript --> <script type="application/javascript"> const x = 1 </script> - <!-- ^ javascript --> + <!-- ^ @javascript --> <script type="module"> import { foo } from "bar" </script> - <!-- ^ javascript --> + <!-- ^ @javascript --> <script defer type="text/javascript"> const x = 1 </script> - <!-- ^ javascript --> + <!-- ^ @javascript --> <script type="text/markdown">## Hello *World*!</script> - <!-- ^ markdown --> + <!-- ^ @markdown --> <script type="application/graphql">query OK { dokey }</script> - <!-- ^ graphql --> + <!-- ^ @graphql --> <script type="application/typescript">type A = number;</script> - <!-- ^ typescript --> + <!-- ^ @typescript --> <script type="application/json">{ "true": false }</script> - <!-- ^ json --> + <!-- ^ @json --> <script type="importmap">{ "true": false }</script> - <!-- ^ json --> + <!-- ^ @json --> <div style="height: 100%"> - <!-- ^ css --> + <!-- ^ @css --> Test div to test css injections for style attributes </div> <input pattern="[0-9]+"> - <!-- ^ regex --> + <!-- ^ @regex --> <input pattern=[0-9]+ type="tel"> - <!-- ^ regex --> + <!-- ^ @regex --> </body> </html> diff --git a/tests/query/injections/svelte/test-svelte-injections.svelte b/tests/query/injections/svelte/test-svelte-injections.svelte index 5a9a03300..ea88aa6a9 100644 --- a/tests/query/injections/svelte/test-svelte-injections.svelte +++ b/tests/query/injections/svelte/test-svelte-injections.svelte @@ -1,23 +1,21 @@ <script> import Button from "./Button.svelte"; </script> -<!-- ^ javascript --> +<!-- ^ @javascript --> <script lang="ts"> const foo: number = 1 </script> -<!-- ^ typescript --> -<!-- ^ !javascript --> +<!-- ^ @typescript --> +<!-- ^ @!javascript --> <style> main { font-family: sans-serif; text-align: center; } </style> -<!-- ^ css --> +<!-- ^ @css --> <style lang="scss"> main { &:hover { } } </style> -<!-- ^ scss --> -<!-- ^ !css --> +<!-- ^ @scss --> +<!-- ^ @!css --> <main> <h1>Test file</h1> {#each someItems as someItem} -<!-- ^ javascript ---> +<!-- ^ @javascript --> <div>{someItem}</div> -<!-- ^ javascript ---> +<!-- ^ @javascript --> {/each} <Button /> <button on:click={() => foo++}></button> diff --git a/tests/query/injections/vue/negative-assertions.vue b/tests/query/injections/vue/negative-assertions.vue index fdc871919..000702a17 100644 --- a/tests/query/injections/vue/negative-assertions.vue +++ b/tests/query/injections/vue/negative-assertions.vue @@ -1,4 +1,4 @@ <script lang="ts"> const foo: number = "1" </script> -<!-- ^ !javascript --> +<!-- ^ @!javascript --> <style lang="scss"> .bar { &-baz { &.page{ } } } </style> -<!-- ^ !css --> +<!-- ^ @!css --> diff --git a/tests/query/injections/vue/test-vue-injections.vue b/tests/query/injections/vue/test-vue-injections.vue index 773e53a5f..4966e6ac0 100644 --- a/tests/query/injections/vue/test-vue-injections.vue +++ b/tests/query/injections/vue/test-vue-injections.vue @@ -1,38 +1,39 @@ <template> <span>{{"Text inside interpolation"}}</span> - <!-- ^ typescript --> + <!-- ^ @typescript --> <template lang="pug"> a(:href="url") some link title in pug: </template> - <!-- ^ pug --> + <!-- ^ @pug --> <template v-if="'text inside directives'"></template> -<!-- ^ typescript --> +<!-- ^ @typescript --> </template> <script> const foo = "1" </script> -<!-- ^ javascript --> +<!-- ^ @javascript --> <script defer> const foo = "1" </script> -<!-- ^ javascript --> +<!-- ^ @javascript --> <script lang="js">function x(){ return 1;}</script> -<!-- ^ javascript --> +<!-- ^ @javascript --> <script lang="ts"> const foo: number = "1" </script> -<!-- ^ typescript --> -<!-- ^ !javascript --> +<!-- ^ @typescript --> +<!-- ^ @!javascript --> <script lang="ts" defer>const foo: number = 1 </script> -<!-- ^ typescript --> -<!-- ^ !javascript --> +<!-- ^ @typescript --> +<!-- ^ @!javascript --> <script lang="tsx" defer>const foo: number = 1</script> - <!-- ^ tsx --> - <!-- ^ !jsx --> - <!-- ^ !typescript --> + <!-- ^ @tsx --> + <!-- ^ @!jsx --> + <!-- ^ @!typescript --> <style> .bar { .foo{ } } </style> -<!-- ^ css --> +<!-- ^ @css --> <style scoped> .page.page--news { background: rebeccapurple; } </style> -<!-- ^ css --> +<!-- ^ @css --> <style lang="css"> .bar { justify-content: center; } </style> -<!-- ^ css --> +<!-- ^ @css --> <style lang="scss"> .bar { &-baz { } } </style> -<!-- ^ scss --> -<!-- ^ !css --> +<!-- ^ @scss --> +<!-- ^ @!css --> <style scoped lang="scss">body{} </style> -<!-- ^ scss --> -<!-- ^ !css --> +<!-- ^ @scss --> +<!-- ^ @!css --> + // const file = files[0]; diff --git a/tests/query/injections/yaml/bash-on-github-actions.yml b/tests/query/injections/yaml/bash-on-github-actions.yml index ba56de193..5c732b09b 100644 --- a/tests/query/injections/yaml/bash-on-github-actions.yml +++ b/tests/query/injections/yaml/bash-on-github-actions.yml @@ -14,10 +14,10 @@ jobs: node-version: '16' - name: Install dependencies run: npm ci - # ^ bash + # ^ @bash - name: Run tests run: npm test - # ^ bash + # ^ @bash - name: Parse Petalisp run: | git submodule init @@ -27,6 +27,6 @@ jobs: else echo "Successfully parsed Petalisp" fi - # ^ bash + # ^ @bash - name: Run tests run: npm test diff --git a/tests/query/injections/yaml/promql-on-prometheus-rules.yaml b/tests/query/injections/yaml/promql-on-prometheus-rules.yaml index 8b1895c16..f064da375 100644 --- a/tests/query/injections/yaml/promql-on-prometheus-rules.yaml +++ b/tests/query/injections/yaml/promql-on-prometheus-rules.yaml @@ -3,7 +3,7 @@ groups: rules: - alert: Node down expr: up{job="node_exporter"} == 0 - # ^ promql + # ^ @promql for: 3m labels: severity: warning @@ -13,7 +13,7 @@ groups: - alert: Node down expr: | up{job="node_exporter"} == 0 - # ^ promql + # ^ @promql for: 3m labels: severity: warning |
