From cd76198b6a6af1581d30dea0f551c38d89f1355f Mon Sep 17 00:00:00 2001 From: Rasmus Mecklenburg <42248344+rmburg@users.noreply.github.com> Date: Tue, 17 Mar 2026 16:59:07 +0100 Subject: [PATCH] feat(queries/typst): add textobjects (#15456) --- book/src/generated/lang-support.md | 2 +- runtime/queries/typst/textobjects.scm | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 runtime/queries/typst/textobjects.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index c116ffc5..7b0f21c1 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -302,7 +302,7 @@ | twig | ✓ | | | | | | | typescript | ✓ | ✓ | ✓ | ✓ | ✓ | `typescript-language-server` | | typespec | ✓ | ✓ | ✓ | | | `tsp-server` | -| typst | ✓ | | | ✓ | | `tinymist` | +| typst | ✓ | ✓ | | ✓ | | `tinymist` | | ungrammar | ✓ | | | | | | | unison | ✓ | ✓ | ✓ | ✓ | ✓ | | | uxntal | ✓ | | | | | | diff --git a/runtime/queries/typst/textobjects.scm b/runtime/queries/typst/textobjects.scm new file mode 100644 index 00000000..516c0afe --- /dev/null +++ b/runtime/queries/typst/textobjects.scm @@ -0,0 +1,23 @@ +(let + pattern: (call) + value: (_) @function.inside) @function.around + +(call + (group + ((_) @parameter.inside . ","? @parameter.around) @parameter.around)) + +(lambda + pattern: + (group + ((_) @parameter.inside . ","? @parameter.around) @parameter.around) + value: (_) @function.inside) @function.around + +(group + [ + (tagged (_) @entry.inside) + (_) + ] @entry.around) + +(comment) @comment.inside + +(comment)+ @comment.around -- 2.51.2