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

re-add indent and textobject queries for perl #7947

Merged
merged 3 commits into from
Sep 10, 2023
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 @@ -112,7 +112,7 @@
| pascal | ✓ | ✓ | | `pasls` |
| passwd | ✓ | | | |
| pem | ✓ | | | |
| perl | ✓ | | | `perlnavigator` |
| perl | ✓ | | | `perlnavigator` |
| php | ✓ | ✓ | ✓ | `intelephense` |
| po | ✓ | ✓ | | |
| pod | ✓ | | | |
Expand Down
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ indent = { tab-width = 2, unit = " " }

[[grammar]]
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]]
name = "pod"
Expand Down
29 changes: 29 additions & 0 deletions runtime/queries/perl/indents.scm
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions runtime/queries/perl/textobjects.scm
Original file line number Diff line number Diff line change
@@ -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
Loading