re-add indent and textobject queries for perl (#7947)

* bump tree-sitter-perl version

need some grammar tweaks for the indent queries to function properly

* add indent queries for perl

* add textobject queries for perl
This commit is contained in:
Jesse Luehrs 2023-09-10 15:27:04 -04:00 committed by GitHub
parent 829db76563
commit 81d6d3ff0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 2 deletions

View file

@ -112,7 +112,7 @@
| pascal | ✓ | ✓ | | `pasls` | | pascal | ✓ | ✓ | | `pasls` |
| passwd | ✓ | | | | | passwd | ✓ | | | |
| pem | ✓ | | | | | pem | ✓ | | | |
| perl | ✓ | | | `perlnavigator` | | perl | ✓ | | | `perlnavigator` |
| php | ✓ | ✓ | ✓ | `intelephense` | | php | ✓ | ✓ | ✓ | `intelephense` |
| po | ✓ | ✓ | | | | po | ✓ | ✓ | | |
| pod | ✓ | | | | | pod | ✓ | | | |

View file

@ -1119,7 +1119,7 @@ indent = { tab-width = 2, unit = " " }
[[grammar]] [[grammar]]
name = "perl" name = "perl"
source = { git = "https://github.com/tree-sitter-perl/tree-sitter-perl", rev = "ed21ecbcc128a6688770ebafd3ef68a1c9bc1ea9" } source = { git = "https://github.com/tree-sitter-perl/tree-sitter-perl", rev = "9f3166800d40267fa68ed8273e96baf74f390517" }
[[language]] [[language]]
name = "pod" name = "pod"

View file

@ -0,0 +1,29 @@
[
(block)
(conditional_statement)
(loop_statement)
(cstyle_for_statement)
(for_statement)
(elsif)
(array_element_expression)
(hash_element_expression)
(coderef_call_expression)
(anonymous_slice_expression)
(slice_expression)
(keyval_expression)
(anonymous_array_expression)
(anonymous_hash_expression)
(stub_expression)
(func0op_call_expression)
(func1op_call_expression)
(map_grep_expression)
(function_call_expression)
(method_call_expression)
(attribute)
] @indent
[
"}"
"]"
")"
] @outdent

View file

@ -0,0 +1,14 @@
(subroutine_declaration_statement
body: (_) @function.inside) @function.around
(anonymous_subroutine_expression
body: (_) @function.inside) @function.around
(package_statement) @class.around
(package_statement
(block) @class.inside)
(list_expression
(_) @parameter.inside)
(comment) @comment.around
(pod) @comment.around