aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Paju2024-02-18 23:46:13 +0000
committerGitHub2024-02-18 23:46:13 +0000
commit2dc9ce68ec84fd26e1489e3bac76fc5114d0023e (patch)
treeecee33bc87795ed4414ca9eb656bbb0702e173ea
parentc72426cc874c70bfb5660b2866e634927e5fb4fd (diff)
Add textobject queries for Nix (#9659)
* Add textobject queries for Nix * Add to lang-support.md
-rw-r--r--book/src/generated/lang-support.md2
-rw-r--r--runtime/queries/nix/textobjects.scm9
2 files changed, 10 insertions, 1 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md
index a37e165f..09ed4dac 100644
--- a/book/src/generated/lang-support.md
+++ b/book/src/generated/lang-support.md
@@ -112,7 +112,7 @@
| nasm | ✓ | ✓ | | |
| nickel | ✓ | | ✓ | `nls` |
| nim | ✓ | ✓ | ✓ | `nimlangserver` |
-| nix | ✓ | | | `nil` |
+| nix | ✓ | ✓ | | `nil` |
| nu | ✓ | | | `nu` |
| nunjucks | ✓ | | | |
| ocaml | ✓ | | ✓ | `ocamllsp` |
diff --git a/runtime/queries/nix/textobjects.scm b/runtime/queries/nix/textobjects.scm
new file mode 100644
index 00000000..1508d4c2
--- /dev/null
+++ b/runtime/queries/nix/textobjects.scm
@@ -0,0 +1,9 @@
+(comment) @comment.inside
+(comment)+ @comment.around
+
+(formals
+ ((_) @parameter.inside . ","? @parameter.around) @parameter.around)
+
+(function_expression
+ body: (_) @function.inside) @function.around
+