diff options
| -rw-r--r-- | queries/hack/highlights.scm | 39 | ||||
| -rw-r--r-- | tests/query/highlights/hack/generics.hack | 6 | ||||
| -rw-r--r-- | tests/query/highlights/xhp-intro.hack | 4 |
3 files changed, 29 insertions, 20 deletions
diff --git a/queries/hack/highlights.scm b/queries/hack/highlights.scm index 0ae9a9bc0..778a0e146 100644 --- a/queries/hack/highlights.scm +++ b/queries/hack/highlights.scm @@ -6,15 +6,15 @@ (braced_expression) @none (scoped_identifier - (qualified_identifier + (qualified_identifier (identifier) @type)) -(comment) @comment -(heredoc) @comment - [ - "function" -] @keyword.function + (comment) + (heredoc) +] @comment + +"function" @keyword.function [ "async" @@ -23,20 +23,21 @@ "interface" "implements" "class" - "protected" - "private" - "public" "using" "namespace" "attribute" "const" - (xhp_modifier) - (final_modifier) "extends" "insteadof" ] @keyword -"use" @include +[ + "use" + "include" + "include_once" + "require" + "require_once" +] @include [ "new" @@ -47,9 +48,15 @@ "as" ] @keyword.operator +"return" @keyword.return + [ - "return" -] @keyword.return + (abstract_modifier) + (final_modifier) + (static_modifier) + (visibility_modifier) + (xhp_modifier) +] @type.qualifier [ "shape" @@ -92,10 +99,10 @@ (qualified_identifier (identifier) @type .)) -(attribute_modifier) @attribute [ "@required" "@lateinit" + (attribute_modifier) ] @attribute [ @@ -262,6 +269,8 @@ [ "</" ">" ] @tag.delimiter) [ "." ";" "::" ":" "," ] @punctuation.delimiter +(qualified_identifier + "\\" @punctuation.delimiter) (ternary_expression ["?" ":"] @conditional) diff --git a/tests/query/highlights/hack/generics.hack b/tests/query/highlights/hack/generics.hack index 06eebc951..9582240b9 100644 --- a/tests/query/highlights/hack/generics.hack +++ b/tests/query/highlights/hack/generics.hack @@ -2,21 +2,21 @@ class Box<T> { // ^ type // ^ type protected T $data; - // ^ keyword + // ^ type.qualifier // ^ type public function __construct(T $data) { // ^ type // ^ parameter // ^ keyword.function - // ^ keyword + // ^ type.qualifier // ^ method $this->data = $data; } public function getData(): T { // ^ method - // ^ keyword + // ^ type.qualifier return $this->data; // ^ operator // ^ variable.builtin diff --git a/tests/query/highlights/xhp-intro.hack b/tests/query/highlights/xhp-intro.hack index 9c03cad21..942d2ff00 100644 --- a/tests/query/highlights/xhp-intro.hack +++ b/tests/query/highlights/xhp-intro.hack @@ -5,8 +5,8 @@ use type Facebook\XHP\HTML\{XHPHTMLHelpers, a, form}; final xhp class a_post extends x\element { -// ^ keyword -// ^ keyword +// ^ type.qualifier +// ^ type.qualifier // ^ keyword use XHPHTMLHelpers; |
