diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 17:04:53 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | df4d11bb95bc7ea9554b55d2211c4704a2594f08 (patch) | |
| tree | 0b3a41bac163f6dc1e5c403e0c7a5547c482ec60 /vendor/queries/clojure/textobjects.scm | |
| parent | 68e30f560e46bb9a30433eb23b4edb1b93d69f46 (diff) | |
| download | pardes-df4d11bb95bc7ea9554b55d2211c4704a2594f08.tar.gz pardes-df4d11bb95bc7ea9554b55d2211c4704a2594f08.zip | |
]f, mif and the other textobject keys use helix's own queries
helix's textobjects.scm for pardes's grammars are vendored in vendor/queries
under MPL-2.0, each with a header naming its source and what it inherits,
inlined; a README says what is there and what is not. syntax.objectAt and
objectNext run them over the file's kept parse, with their #eq? and #match?
predicates, for ]f [f ]t [t ]a [a ]c [c ]T [T ]e [e ]x [x and mi/ma with
f t a c T e x. erlang's and zig's queries do not compile against the grammar
versions pardes builds and are left out; fortran, markdown and powershell
have none in helix. A test replays sixteen Python and JSON cases whose
results were taken from the installed hx, and another holds that every
vendored query compiles.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'vendor/queries/clojure/textobjects.scm')
| -rw-r--r-- | vendor/queries/clojure/textobjects.scm | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/vendor/queries/clojure/textobjects.scm b/vendor/queries/clojure/textobjects.scm new file mode 100644 index 00000000..5121ff8c --- /dev/null +++ b/vendor/queries/clojure/textobjects.scm @@ -0,0 +1,76 @@ +; Vendored from helix (https://github.com/helix-editor/helix) at 278b24389: +; runtime/queries/clojure/textobjects.scm. +; Licensed under the Mozilla Public License 2.0 (vendor/queries/helix.LICENSE, +; https://mozilla.org/MPL/2.0/). + +; Function definitions (defn, defn-, defmacro, defmethod, etc.) +(list_lit + . + (sym_lit) @_keyword + . + (sym_lit) + (_)* @function.inside + (#match? @_keyword "^(defn|defn-|defmacro|defmethod|defmulti|definline)$")) @function.around + +; Anonymous functions (fn) +(list_lit + . + (sym_lit) @_fn + (_)* @function.inside + (#match? @_fn "^fn$")) @function.around + +; Anonymous function shorthand #() +(anon_fn_lit + (_)* @function.inside) @function.around + +; deftype, defrecord, defprotocol +(list_lit + . + (sym_lit) @_keyword + . + (sym_lit) + (_)* @class.inside + (#match? @_keyword "^(deftype|defrecord|defprotocol|definterface|defstruct)$")) @class.around + +; Test definitions (deftest) +(list_lit + . + (sym_lit) @_keyword + . + (sym_lit) + (_)* @test.inside + (#match? @_keyword "^deftest$")) @test.around + +; Function parameters in vectors +(vec_lit + (_)* @parameter.inside) @parameter.around + +; List entries +(list_lit + (_) @entry.inside @entry.around) + +; Vector entries +(vec_lit + (_) @entry.inside @entry.around) + +; Map entries +(map_lit + (_) @entry.inside @entry.around) + +; Set entries +(set_lit + (_) @entry.inside @entry.around) + +; Comments +(comment) @comment.inside +(comment)+ @comment.around + +; Discard expressions (also treated as comments) +(dis_expr) @comment.inside + +; Comment special form (comment ...) +(list_lit + . + (sym_lit) @_comment + (_)* @comment.inside + (#match? @_comment "^comment$")) @comment.around |
