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 /tests/query/highlights/hack | |
| 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
Diffstat (limited to 'tests/query/highlights/hack')
| -rw-r--r-- | tests/query/highlights/hack/as-foreach.hack | 4 | ||||
| -rw-r--r-- | tests/query/highlights/hack/async-functions.hack | 6 | ||||
| -rw-r--r-- | tests/query/highlights/hack/attribute-type.hack | 6 | ||||
| -rw-r--r-- | tests/query/highlights/hack/generics.hack | 26 | ||||
| -rw-r--r-- | tests/query/highlights/hack/heredoc-dollar.hack | 2 | ||||
| -rw-r--r-- | tests/query/highlights/hack/shapes.hack | 10 | ||||
| -rw-r--r-- | tests/query/highlights/hack/use.hack | 28 | ||||
| -rw-r--r-- | tests/query/highlights/hack/using.hack | 4 | ||||
| -rw-r--r-- | tests/query/highlights/hack/xhp.hack | 6 |
9 files changed, 46 insertions, 46 deletions
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(); |
