From 7af37bb3b96104b82e56d0072ca0d9a7b226c141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Gajd=C5=AF=C5=A1ek?= Date: Mon, 7 Aug 2023 20:27:35 +0200 Subject: [PATCH] Add tree-sitter textobjects queries for bash (#7764) 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. --- book/src/generated/lang-support.md | 2 +- runtime/queries/bash/textobjects.scm | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/bash/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index cb3a6f55d..28c421f4f 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -2,7 +2,7 @@ | --- | --- | --- | --- | --- | | astro | ✓ | | | | | awk | ✓ | ✓ | | `awk-language-server` | -| bash | ✓ | | ✓ | `bash-language-server` | +| bash | ✓ | ✓ | ✓ | `bash-language-server` | | bass | ✓ | | | `bass` | | beancount | ✓ | | | | | bibtex | ✓ | | | `texlab` | diff --git a/runtime/queries/bash/textobjects.scm b/runtime/queries/bash/textobjects.scm new file mode 100644 index 000000000..59983b30c --- /dev/null +++ b/runtime/queries/bash/textobjects.scm @@ -0,0 +1,9 @@ +(function_definition + body: (_) @function.inside) @function.around + +(command + argument: (_) @parameter.inside) + +(comment) @comment.inside + +(comment)+ @comment.around