From 6a61461d18039de7ebc8fd51f2b6ec0d4e562431 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Sun, 28 Nov 2021 15:12:08 +0100 Subject: highlights(hack): add keywords implements --- tests/query/highlights/hack/attribute-type.hack | 2 +- tests/query/highlights/hack/generics.hack | 1 + tests/query/highlights/hack/shapes.hack | 12 ++++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 tests/query/highlights/hack/shapes.hack (limited to 'tests/query/highlights/hack') diff --git a/tests/query/highlights/hack/attribute-type.hack b/tests/query/highlights/hack/attribute-type.hack index 9f62d19df..5ab9eaa4b 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) <> newtype T3 as int = int; diff --git a/tests/query/highlights/hack/generics.hack b/tests/query/highlights/hack/generics.hack index ea605420c..06eebc951 100644 --- a/tests/query/highlights/hack/generics.hack +++ b/tests/query/highlights/hack/generics.hack @@ -8,6 +8,7 @@ class Box { 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 000000000..0f6ab3448 --- /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 + ); +} -- cgit v1.2.3-70-g09d2