summaryrefslogtreecommitdiffstats
path: root/queries/hack
diff options
context:
space:
mode:
authorPham Huy Hoang <hoangtun0810@gmail.com>2024-01-06 15:05:50 +0900
committerChristian Clason <c.clason@uni-graz.at>2024-01-19 16:58:37 +0100
commit57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9 (patch)
tree70bf645539882b88e6fa129cefd30986b89bbac3 /queries/hack
parentci: add query lint job (diff)
downloadnvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.gz
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.bz2
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.lz
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.xz
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.tar.zst
nvim-treesitter-57a8acf0c4ed5e7f6dda83c3f9b073f8a99a70f9.zip
chore: query formatting
Diffstat (limited to 'queries/hack')
-rw-r--r--queries/hack/highlights.scm177
1 files changed, 114 insertions, 63 deletions
diff --git a/queries/hack/highlights.scm b/queries/hack/highlights.scm
index 91efe90b4..22fa7ea50 100644
--- a/queries/hack/highlights.scm
+++ b/queries/hack/highlights.scm
@@ -1,13 +1,15 @@
(variable) @variable
+
(identifier) @variable
+
((variable) @variable.builtin
- (#eq? @variable.builtin "$this"))
+ (#eq? @variable.builtin "$this"))
(braced_expression) @none
(scoped_identifier
- (qualified_identifier
- (identifier) @type))
+ (qualified_identifier
+ (identifier) @type))
[
(comment)
@@ -20,16 +22,16 @@
"function" @keyword.function
[
- "type"
- "interface"
- "implements"
- "class"
- "using"
- "namespace"
- "attribute"
- "const"
- "extends"
- "insteadof"
+ "type"
+ "interface"
+ "implements"
+ "class"
+ "using"
+ "namespace"
+ "attribute"
+ "const"
+ "extends"
+ "insteadof"
] @keyword
[
@@ -38,11 +40,11 @@
] @keyword.coroutine
[
- "use"
- "include"
- "include_once"
- "require"
- "require_once"
+ "use"
+ "include"
+ "include_once"
+ "require"
+ "require_once"
] @keyword.import
[
@@ -80,9 +82,7 @@
"noreturn"
] @type.builtin
-[
- (null)
-] @constant.builtin
+(null) @constant.builtin
[
(true)
@@ -90,14 +90,23 @@
] @boolean
(type_specifier) @type
+
(new_expression
(_) @type)
-(alias_declaration "newtype" . (_) @type)
-(alias_declaration "type" . (_) @type)
+(alias_declaration
+ "newtype"
+ .
+ (_) @type)
+
+(alias_declaration
+ "type"
+ .
+ (_) @type)
(class_declaration
name: (identifier) @type)
+
(type_parameter
name: (identifier) @type)
@@ -106,8 +115,8 @@
(identifier) @type .))
[
- "@required"
- "@lateinit"
+ "@required"
+ "@lateinit"
(attribute_modifier)
] @attribute
@@ -126,7 +135,6 @@
"/="
"%="
"**="
-
"==>"
"|>"
"??"
@@ -154,13 +162,10 @@
"/"
"%"
"**"
-
"++"
"--"
"!"
-
"?:"
-
"="
"??="
".="
@@ -176,110 +181,156 @@
"%="
"**="
"=>"
-
- ;; type modifiers
+ ; type modifiers
"@"
"?"
"~"
] @operator
(integer) @number
+
(float) @number.float
(parameter
(variable) @variable.parameter)
(call_expression
- function: (qualified_identifier (identifier) @function.call .))
+ function:
+ (qualified_identifier
+ (identifier) @function.call .))
(call_expression
- function: (scoped_identifier (identifier) @function.call .))
+ function:
+ (scoped_identifier
+ (identifier) @function.call .))
(call_expression
- function: (selection_expression
- (qualified_identifier (identifier) @function.method.call .)))
+ function:
+ (selection_expression
+ (qualified_identifier
+ (identifier) @function.method.call .)))
(qualified_identifier
- (_) @module .
+ (_) @module
+ .
(_))
(use_statement
(qualified_identifier
- (_) @module .)
+ (_) @module .)
(use_clause))
(use_statement
- (use_type "namespace")
+ (use_type
+ "namespace")
(use_clause
(qualified_identifier
- (identifier) @module .)
+ (identifier) @module .)
alias: (identifier)? @module))
(use_statement
- (use_type "const")
+ (use_type
+ "const")
(use_clause
(qualified_identifier
- (identifier) @constant .)
+ (identifier) @constant .)
alias: (identifier)? @constant))
(use_statement
- (use_type "function")
+ (use_type
+ "function")
(use_clause
(qualified_identifier
- (identifier) @function .)
+ (identifier) @function .)
alias: (identifier)? @function))
(use_statement
- (use_type "type")
+ (use_type
+ "type")
(use_clause
(qualified_identifier
- (identifier) @type .)
+ (identifier) @type .)
alias: (identifier)? @type))
(use_clause
- (use_type "namespace")
+ (use_type
+ "namespace")
(qualified_identifier
- (_) @module .)
+ (_) @module .)
alias: (identifier)? @module)
(use_clause
- (use_type "function")
+ (use_type
+ "function")
(qualified_identifier
- (_) @function .)
+ (_) @function .)
alias: (identifier)? @function)
(use_clause
- (use_type "const")
+ (use_type
+ "const")
(qualified_identifier
- (_) @constant .)
+ (_) @constant .)
alias: (identifier)? @constant)
(use_clause
- (use_type "type")
+ (use_type
+ "type")
(qualified_identifier
- (_) @type .)
+ (_) @type .)
alias: (identifier)? @type)
(function_declaration
name: (identifier) @function)
+
(method_declaration
name: (identifier) @function.method)
(type_arguments
- [ "<" ">" ] @punctuation.bracket)
-[ "(" ")" "[" "]" "{" "}" "<<" ">>"] @punctuation.bracket
+ [
+ "<"
+ ">"
+ ] @punctuation.bracket)
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+ "<<"
+ ">>"
+] @punctuation.bracket
(xhp_open
- [ "<" ">" ] @tag.delimiter)
+ [
+ "<"
+ ">"
+ ] @tag.delimiter)
+
(xhp_close
- [ "</" ">" ] @tag.delimiter)
+ [
+ "</"
+ ">"
+ ] @tag.delimiter)
+
+[
+ "."
+ ";"
+ "::"
+ ":"
+ ","
+] @punctuation.delimiter
-[ "." ";" "::" ":" "," ] @punctuation.delimiter
(qualified_identifier
"\\" @punctuation.delimiter)
(ternary_expression
- ["?" ":"] @keyword.conditional.ternary)
+ [
+ "?"
+ ":"
+ ] @keyword.conditional.ternary)
[
"if"
@@ -305,11 +356,11 @@
] @keyword.repeat
[
- (string)
- (xhp_string)
+ (string)
+ (xhp_string)
] @string
[
- (xhp_open)
- (xhp_close)
+ (xhp_open)
+ (xhp_close)
] @tag