aboutsummaryrefslogtreecommitdiffstats
path: root/queries/php_only
diff options
context:
space:
mode:
authorCaleb White <cdwhite3@pm.me>2024-08-18 05:30:04 -0500
committerGitHub <noreply@github.com>2024-08-18 12:30:04 +0200
commitec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631 (patch)
treec7ba6a551dc8fa364104378872d2cad5ff0b6d9b /queries/php_only
parentbot(lockfile): update go, html, json, python, rust, swift, vhs (diff)
downloadnvim-treesitter-ec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631.tar
nvim-treesitter-ec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631.tar.gz
nvim-treesitter-ec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631.tar.bz2
nvim-treesitter-ec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631.tar.lz
nvim-treesitter-ec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631.tar.xz
nvim-treesitter-ec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631.tar.zst
nvim-treesitter-ec8776ed9ef56ffe7a61e67b64d5d6b6aba2c631.zip
feat(php): php 8.4 support (#6741)
* chore(php): update maintainers * feat(php): update php rules, highlight imported functions/consts * feat(php): indent inside property hooks * chore: update php and php_only revision
Diffstat (limited to 'queries/php_only')
-rw-r--r--queries/php_only/highlights.scm25
-rw-r--r--queries/php_only/indents.scm6
-rw-r--r--queries/php_only/locals.scm2
3 files changed, 26 insertions, 7 deletions
diff --git a/queries/php_only/highlights.scm b/queries/php_only/highlights.scm
index 2b9e4ea95..790bd088f 100644
--- a/queries/php_only/highlights.scm
+++ b/queries/php_only/highlights.scm
@@ -221,10 +221,26 @@
(name) @type
(qualified_name
(name) @type)
+ alias: (name) @type.definition
])
-(namespace_aliasing_clause
- (name) @type.definition)
+(namespace_use_clause
+ type: "function"
+ [
+ (name) @function
+ (qualified_name
+ (name) @function)
+ alias: (name) @function
+ ])
+
+(namespace_use_clause
+ type: "const"
+ [
+ (name) @constant
+ (qualified_name
+ (name) @constant)
+ alias: (name) @constant
+ ])
(class_interface_clause
[
@@ -369,9 +385,8 @@
name: (namespace_name
(name) @module))
-(namespace_name_as_prefix
- (namespace_name
- (name) @module))
+(namespace_name
+ (name) @module)
; Attributes
(attribute_list) @attribute
diff --git a/queries/php_only/indents.scm b/queries/php_only/indents.scm
index fef026757..1755d4285 100644
--- a/queries/php_only/indents.scm
+++ b/queries/php_only/indents.scm
@@ -13,12 +13,13 @@
(match_block)
(case_statement)
(default_statement)
+ (property_hook_list)
] @indent.begin
(return_statement
[
(object_creation_expression)
- (anonymous_function_creation_expression)
+ (anonymous_function)
(arrow_function)
(match_expression)
]) @indent.dedent
@@ -49,6 +50,9 @@
(return_statement
";" @indent.end)
+(property_hook_list
+ "}" @indent.end)
+
(ERROR
"(" @indent.align
.
diff --git a/queries/php_only/locals.scm b/queries/php_only/locals.scm
index aff2b3dae..6739b383d 100644
--- a/queries/php_only/locals.scm
+++ b/queries/php_only/locals.scm
@@ -12,7 +12,7 @@
name: (name) @local.definition.function) @local.scope
(#set! definition.function.scope "parent"))
-(anonymous_function_creation_expression
+(anonymous_function
(anonymous_function_use_clause
(variable_name
(name) @local.definition.var))) @local.scope