aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--book/src/generated/lang-support.md2
-rw-r--r--runtime/queries/php/textobjects.scm30
2 files changed, 31 insertions, 1 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index eff82226..85371773 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -40,7 +40,7 @@
| ocaml | ✓ | | ✓ | |
| ocaml-interface | ✓ | | | |
| perl | ✓ | ✓ | ✓ | |
-| php | ✓ | | ✓ | |
+| php | ✓ | ✓ | ✓ | |
| prolog | | | | `swipl` |
| protobuf | ✓ | | ✓ | |
| python | ✓ | ✓ | ✓ | `pylsp` |
diff --git a/runtime/queries/php/textobjects.scm b/runtime/queries/php/textobjects.scm
new file mode 100644
index 00000000..04ffefd2
--- /dev/null
+++ b/runtime/queries/php/textobjects.scm
@@ -0,0 +1,30 @@
+(class_declaration
+ body: (_) @class.inside) @class.around
+
+(interface_declaration
+ body: (_) @class.inside) @class.around
+
+(trait_declaration
+ body: (_) @class.inside) @class.around
+
+(enum_declaration
+ body: (_) @class.inside) @class.around
+
+(function_definition
+ body: (_) @function.inside) @function.around
+
+(method_declaration
+ body: (_) @function.inside) @function.around
+
+(arrow_function
+ body: (_) @function.inside) @function.around
+
+(anonymous_function_creation_expression
+ body: (_) @function.inside) @function.around
+
+(formal_parameters
+ [
+ (simple_parameter)
+ (variadic_parameter)
+ (property_promotion_parameter)
+ ] @parameter.inside)