Skip to content

Commit

Permalink
Add tree-sitter textobjects queries for bash (helix-editor#7764)
Browse files Browse the repository at this point in the history
This implements function, (calling) argument and comment captures for use
in the textobject selections in bash.

This also updates the generated docs after adding the textobjects for bash.
  • Loading branch information
gajdusek authored and Schuyler Mortimer committed Jul 10, 2024
1 parent 8588e6a commit f06289f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
| --- | --- | --- | --- | --- |
| astro || | | |
| awk ||| | `awk-language-server` |
| bash || || `bash-language-server` |
| bash || || `bash-language-server` |
| bass || | | `bass` |
| beancount || | | |
| bibtex || | | `texlab` |
Expand Down
9 changes: 9 additions & 0 deletions runtime/queries/bash/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(function_definition
body: (_) @function.inside) @function.around

(command
argument: (_) @parameter.inside)

(comment) @comment.inside

(comment)+ @comment.around

0 comments on commit f06289f

Please sign in to comment.