summaryrefslogtreecommitdiff
path: root/tests/query
diff options
context:
space:
mode:
Diffstat (limited to 'tests/query')
-rw-r--r--tests/query/highlights/hack/attribute-type.hack2
-rw-r--r--tests/query/highlights/hack/generics.hack1
-rw-r--r--tests/query/highlights/hack/shapes.hack12
3 files changed, 14 insertions, 1 deletions
diff --git a/tests/query/highlights/hack/attribute-type.hack b/tests/query/highlights/hack/attribute-type.hack
index 9f62d19d..5ab9eaa4 100644
--- a/tests/query/highlights/hack/attribute-type.hack
+++ b/tests/query/highlights/hack/attribute-type.hack
@@ -9,7 +9,7 @@ newtype T1 = ?shape(
// ^ attribute
type T2 = (function(T1): string);
// ^ type
-// ^ function (cannot capture keyword "function" as keyword.function)
+// TODO: keyword.function (currently not in AST)
<<A4(1), A5, A6(1,3,4)>>
newtype T3 as int = int;
diff --git a/tests/query/highlights/hack/generics.hack b/tests/query/highlights/hack/generics.hack
index ea605420..06eebc95 100644
--- a/tests/query/highlights/hack/generics.hack
+++ b/tests/query/highlights/hack/generics.hack
@@ -8,6 +8,7 @@ class Box<T> {
public function __construct(T $data) {
// ^ type
// ^ parameter
+ // ^ keyword.function
// ^ keyword
// ^ method
$this->data = $data;
diff --git a/tests/query/highlights/hack/shapes.hack b/tests/query/highlights/hack/shapes.hack
new file mode 100644
index 00000000..0f6ab344
--- /dev/null
+++ b/tests/query/highlights/hack/shapes.hack
@@ -0,0 +1,12 @@
+class C extends Superclass implements Iface {
+// ^ keyword ^ keyword
+ use Trait;
+ // < include
+ const type X = shape(
+ // <- keyword ^ type.builtin
+ "a" => int,
+ // ^ string
+ "b" => string,
+ // ^ type.builtin
+ );
+}