is there a navigation function like end-of-defun
, that works on the ignored expressions (`#_) hidden expressions in cider. I was using
end-of-defun` but maybe there's been a change and it doesn't navigate properly to the end of the ignore expression
Could you be a little more specific about the behavior you're expecting? Like maybe a form
(let [a 1 b 2] |#_(ignored form) (+ a b))
combined with where you expect the cursor to end up post navigation?yes, so in my case I am working on a fn that will evaluation n forms from the current cursor, so say I have my cursor
(defn test-fn |[a] ...)
#_[(test-fn 1)
(test-fn [])]
I want to first go to the end of the current form and evaluate last sexp, end-of-defun
moves the cursor in the right place, after the current form, and I can evaluate fine. When I try end-of-defun
again, the cursor ends up here:
#_|[(test-fn 1)
(test-fn [])]
I expected another end-of-defun to go to the end of that sexp after it, but it skips it and goes to the end of whatever form is after thatI can work with just having it not uncommented, and comment it later since I expect to move it to a test area
(defun +user/eval-n-defuns (n)
(interactive "P")
(save-excursion
(dotimes (number (or n 2))
(end-of-defun)
(+user/run-eval-fun))))
the +user/run-eval-fun
just executes which eval to use in which major-modeAcrually, ideally I want it not to skip, as you can properly cider-eval-last-sexp of an ignored form with cider. The purpose is to have the function you're testing above a commented form of usages of that function for quick feedback when you are developing. Then eventually move those usages to test cases. It's based on a technique I saw a blog about and used ever since. At the time it did work with those ignored forms
Then test for #_
and run paredit-forword-sexp
instead of what I suggested. :)
You also may be interested in this discussion. :) https://clojurians.slack.com/archives/C099W16KZ/p1625077166109100?thread_ts=1624974213.101000&cid=C099W16KZ
The good thing about my way is it displays the result inline, so if I want to set up a quick case I can see the result rather than "test pass" or "test fail". This helps craft output in a quicker way this was the gist I took it from https://gist.github.com/cstby/0cff1f7eb48eb18c6690e6cdb919ca69
I was also mistaken, before bounds-of-thing-at-point
worked
either way, I think I can figure out something for those
:thumbsup: