aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query
diff options
context:
space:
mode:
authorCaleb White <cdwhite3@pm.me>2024-03-19 09:02:08 -0500
committerChristian Clason <c.clason@uni-graz.at>2024-03-27 08:29:44 +0100
commit4ebf4ca4fad78866359d6e7126202f1791264416 (patch)
tree48b71cee3500b0f2547dae4dc178005c68dcaa78 /tests/query
parentfix(php): fix use_{as,instead_of}_clause highlights (diff)
downloadnvim-treesitter-4ebf4ca4fad78866359d6e7126202f1791264416.tar
nvim-treesitter-4ebf4ca4fad78866359d6e7126202f1791264416.tar.gz
nvim-treesitter-4ebf4ca4fad78866359d6e7126202f1791264416.tar.bz2
nvim-treesitter-4ebf4ca4fad78866359d6e7126202f1791264416.tar.lz
nvim-treesitter-4ebf4ca4fad78866359d6e7126202f1791264416.tar.xz
nvim-treesitter-4ebf4ca4fad78866359d6e7126202f1791264416.tar.zst
nvim-treesitter-4ebf4ca4fad78866359d6e7126202f1791264416.zip
chore(php): trim down tests
Diffstat (limited to 'tests/query')
-rw-r--r--tests/query/highlights/php/keywords.php122
-rw-r--r--tests/query/highlights/php/literals.php26
-rw-r--r--tests/query/highlights/php/types.php7
-rw-r--r--tests/query/highlights/php/variables.php1
4 files changed, 3 insertions, 153 deletions
diff --git a/tests/query/highlights/php/keywords.php b/tests/query/highlights/php/keywords.php
index 4bacf1c9d..f3d3f95a7 100644
--- a/tests/query/highlights/php/keywords.php
+++ b/tests/query/highlights/php/keywords.php
@@ -1,101 +1,28 @@
<?php
-//^^^ @punctuation.bracket
-
-declare(strict_types=1);
-//^^^^^ @keyword
-// ^^^^^^^^^^^^ @variable.parameter
-// ^ @operator
-// ^ @number
-// ^ @punctuation.delimiter
-
-include "file.php";
-//^^^^^ @keyword.import
-// ^^^^^^^^^ @string
-include_once "file.php";
-//^^^^^^^^^^ @keyword.import
-require "file.php";
-//^^^^^ @keyword.import
-require_once "file.php";
-//^^^^^^^^^^ @keyword.import
-
-namespace A\B;
-//^^^^^^^ @keyword
-// ^^^ @module
-
-if ($a and $b or $c xor $d) {} elseif ($b) {} else {}
-// <- @keyword.conditional
-// ^^^ @keyword.operator
-// ^^ @keyword.operator
-// ^^^ @keyword.operator
-// ^^^^^^ @keyword.conditional
-// ^^^^ @keyword.conditional
-
-for ($i = 0; $i < 1; $i++) { continue; }
-// <- @keyword.repeat
-// ^ @operator
-// ^^ @operator
-// ^^^^^^^^ @keyword.repeat
-
-while ($b) {}
-//^^^ @keyword.repeat
-
-do { } while ($c);
-// <- @keyword.repeat
-// ^^^^^ @keyword.repeat
-
-foreach ($foos as $foo) {}
-//^^^^^ @keyword.repeat
-// ^^ @keyword.operator
-
-try {} catch (Exception $e) {} finally {}
-//^ @keyword.exception
-// ^^^^^ @keyword.exception
-// ^^^^^^^^^ @type
-// ^^^^^^^ @keyword.exception
-
-function a() {}
-//^^^^^^ @keyword.function
-// ^ @function
abstract class A
-//^^^^^^ @keyword.modifier
-// ^^^^^ @keyword
-// ^ @type
{
- private const BAR = 1;
-//^^^^^^^ @keyword.modifier
-// ^^^^^ @keyword.modifier
- // ^^^ @constant
protected readonly static $a;
//^^^^^^^^^ @keyword.modifier
// ^^^^^^^^ @keyword.modifier
// ^^^^^^ @keyword.modifier
- // ^^ @property
- final public $b;
-//^^^^^ @keyword.modifier
public static function foo(): static {}
//^^^^^^ @keyword.modifier
// ^^^^^^ @keyword.modifier
// ^^^^^^^^ @keyword.function
// ^^^ @function.method
// ^^^^^^ @type.builtin
- public function __construct() {}
-// ^^^^^^^^^^^ @constructor
}
class B extends A implements T
// ^ @type
// ^^^^^^^ @keyword
-// ^ @type
// ^^^^^^^^^^ @keyword
-// ^ @type
{
use T, U {
//^^^ @keyword.import
-// ^ @punctuation.delimiter
U::small insteadof T;
// ^ @type
-// ^^ @operator
// ^^^^^ @function.method
// ^^^^^^^^^ @keyword
// ^ @type
@@ -115,44 +42,12 @@ class B extends A implements T
// ^^^^^^^^ @type.builtin
// ^^^^ @type.builtin
{
- $call instanceof Closure;
-// ^^^^^ @variable
-// ^^^^^^^^^^ @keyword.operator
-// ^^^^^^^ @type
- fn ($a, $b) => $a + $b;
-// ^^ @keyword.function
static $a;
// ^^^^^^ @keyword.modifier
- global $a;
-// ^^^^^^ @keyword
- clone $call;
-// ^^^^^ @keyword
- match ($a) {
-// ^^^^^ @keyword.conditional
- default => "other",
-// ^^^^^^^ @keyword
-// ^^ @operator
- };
-
- switch ($a) {
-// ^^^^^^ @keyword.conditional
- case 'value':
-// ^^^^ @keyword.conditional
- break;
-// ^^^^^ @keyword
- default:
-// ^^^^^^^ @keyword
- }
yield $a;
// ^^^^^ @keyword.return
yield from $a;
// ^^^^ @keyword.return
- return $a;
-// ^^^^^^ @keyword.return
- goto a;
-// ^^^^ @keyword
- echo "a";
-// ^^^^ @keyword
print "a";
// ^^^^^ @keyword
print("a");
@@ -165,20 +60,3 @@ class B extends A implements T
// ^^^^ @function.builtin
}
}
-
-throw new Exception("oh");
-//^^^ @keyword.exception
-// ^^^ @keyword
-// ^^^^^^^^^ @constructor
-
-interface T {}
-//^^^^^^^ @keyword
-// ^ @type
-
-trait T { public function small(): void {} }
-//^^^ @keyword
-// ^ @type
-// ^^^^ @type.builtin
-enum Foo { case Bar; }
-//^^ @keyword
-// ^^^^ @keyword.conditional
diff --git a/tests/query/highlights/php/literals.php b/tests/query/highlights/php/literals.php
deleted file mode 100644
index 17b539362..000000000
--- a/tests/query/highlights/php/literals.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-echo <<<OMG
-// ^^^ @operator
-// ^^^ @label
- something
-OMG;
-//^ @label
-
-echo true, TRUE, false, FALSE;
-// ^^^^ @boolean
-// ^^^^ @boolean
-// ^^^^^ @boolean
-// ^^^^^ @boolean
-
-echo PI_314;
-// ^^^^^^ @constant
-
-echo __DIR__;
-// ^^^^^^^ @constant.builtin
-
-echo null, 42, 42.524, "Testing\n";
-// ^^^^ @constant.builtin
-// ^^ @number
-// ^^^^^^ @number.float
-// ^^ @string.escape
diff --git a/tests/query/highlights/php/types.php b/tests/query/highlights/php/types.php
index 7a3adb233..5985d6361 100644
--- a/tests/query/highlights/php/types.php
+++ b/tests/query/highlights/php/types.php
@@ -1,12 +1,11 @@
<?php
-function b(int $a, string $b, Person $e): Foo\Dog {}
+function b(int $a, string $b): Foo\Dog {}
// ^^^ @type.builtin
// ^^ @variable
// ^^^^^^ @type.builtin
-// ^^^^^^ @type
-// ^^^ @module
-// ^^^ @type
+// ^^^ @module
+// ^^^ @type
function a(array $b) {
// ^^^^^ @type.builtin
diff --git a/tests/query/highlights/php/variables.php b/tests/query/highlights/php/variables.php
index 6a466357c..a9c099ff2 100644
--- a/tests/query/highlights/php/variables.php
+++ b/tests/query/highlights/php/variables.php
@@ -11,7 +11,6 @@ class A {
// ^^^^^^ @constructor
$this->foo();
// ^^^^ @variable.builtin
-// ^^ @operator
// ^^^ @function.method.call
self::foo();
// ^^^^ @variable.builtin