Skip to content

perl: flesh out textobjects queries#891

Open
rabbiveesh wants to merge 2 commits into
nvim-treesitter:mainfrom
rabbiveesh:perl-textobjects
Open

perl: flesh out textobjects queries#891
rabbiveesh wants to merge 2 commits into
nvim-treesitter:mainfrom
rabbiveesh:perl-textobjects

Conversation

@rabbiveesh

Copy link
Copy Markdown

Expands queries/perl/textobjects.scm from just comment/regex to the full standard textobject set:

  • function — named subs, methods, anonymous subs
  • classpackage / class / role (block form)
  • parameter — signature params and call arguments
  • conditionalif / elsif / else
  • loopwhile/until, foreach, C-style for
  • call, assignment (incl. lhs/rhs), attribute, block, return

Keeps the existing regex and comment captures.

All captures validated against the current tree-sitter-perl grammar. I was not able to run make query / make docs locally, so please re-run the formatter / doc generation if styling needs normalizing.

Expands the perl textobjects from comment/regex only to the full standard
set: function, class (package/class/role), parameter (signature params +
call args), conditional (if/elsif/else), loop (while/until, foreach,
C-style for), call, assignment (+lhs/rhs), attribute, block, and return.
Keeps the existing regex and comment captures.

All captures validated against the current tree-sitter-perl grammar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant