Fork me on GitHub
#joyride
<
2022-12-05
>
David Yang17:12:23

hey - how would I find all top level (comment …) blocks in a file and fold them? would love an example on navigating clojure AST

pez18:12:01

Iirc, there is only a command for folding. So you probably will have to place the cursor and then issue this command. Calva has API for figuring out the current top level form: https://calva.io/api/#rangescurrenttopleveldef I think the example for ignoring out the current enclosing form should be useful for figuring out how to record the current selection and restore it. Though maybe that doesn’t make much sense once the form is folded…