Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add textobjects queries for php #1601

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
| ocaml | ✓ | | ✓ | |
| ocaml-interface | ✓ | | | |
| perl | ✓ | ✓ | ✓ | |
| php | ✓ | | ✓ | |
| php | ✓ | | ✓ | |
| prolog | | | | `swipl` |
| protobuf | ✓ | | ✓ | |
| python | ✓ | ✓ | ✓ | `pylsp` |
Expand Down
30 changes: 30 additions & 0 deletions runtime/queries/php/textobjects.scm
Original file line number Diff line number Diff line change
@@ -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)