emacs

Consider also joining #cider, #lsp and #inf-clojure, where most of the tool-specific discussions are happening.
theeternalpulse 2021-06-30T04:56:54.108200Z

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

2021-06-30T18:13:25.108900Z

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?

theeternalpulse 2021-07-01T00:07:35.111800Z

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 that

theeternalpulse 2021-07-01T00:08:06.112Z

I can work with just having it not uncommented, and comment it later since I expect to move it to a test area

theeternalpulse 2021-07-01T00:09:48.112200Z

(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-mode

theeternalpulse 2021-07-01T14:55:36.114700Z

Acrually, 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

2021-07-01T15:10:55.114900Z

Then test for #_ and run paredit-forword-sexp instead of what I suggested. :)

2021-07-01T15:11:32.115100Z

You also may be interested in this discussion. :) https://clojurians.slack.com/archives/C099W16KZ/p1625077166109100?thread_ts=1624974213.101000&cid=C099W16KZ

theeternalpulse 2021-07-01T17:09:40.115600Z

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

theeternalpulse 2021-07-01T17:10:33.115800Z

I was also mistaken, before bounds-of-thing-at-point worked

theeternalpulse 2021-07-01T17:14:08.116Z

either way, I think I can figure out something for those

2021-07-01T18:05:28.116200Z

:thumbsup: