From 81d6d3ff0eace62481863b7957b5ccc52b1c6718 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 10 Sep 2023 15:27:04 -0400 Subject: 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--- runtime/queries/perl/indents.scm | 29 +++++++++++++++++++++++++++++ runtime/queries/perl/textobjects.scm | 14 ++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 runtime/queries/perl/indents.scm create mode 100644 runtime/queries/perl/textobjects.scm (limited to 'runtime') diff --git a/runtime/queries/perl/indents.scm b/runtime/queries/perl/indents.scm new file mode 100644 index 00000000..03318243 --- /dev/null +++ b/runtime/queries/perl/indents.scm @@ -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 diff --git a/runtime/queries/perl/textobjects.scm b/runtime/queries/perl/textobjects.scm new file mode 100644 index 00000000..1b0b5f07 --- /dev/null +++ b/runtime/queries/perl/textobjects.scm @@ -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 -- cgit v1.2.3-70-g09d2