This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (4)
- # beginners (80)
- # boot (4)
- # cbus (2)
- # cider (62)
- # clara (18)
- # cljs-dev (8)
- # cljsrn (10)
- # clojure (139)
- # clojure-brasil (3)
- # clojure-dev (27)
- # clojure-italy (1)
- # clojure-russia (3)
- # clojure-spec (4)
- # clojure-uk (47)
- # clojurescript (102)
- # core-async (10)
- # cursive (7)
- # datomic (71)
- # emacs (32)
- # fulcro (99)
- # funcool (1)
- # hoplon (3)
- # jobs (1)
- # jobs-discuss (6)
- # jobs_rus (2)
- # leiningen (3)
- # luminus (2)
- # lumo (14)
- # mount (7)
- # off-topic (19)
- # re-frame (25)
- # ring-swagger (4)
- # rum (3)
- # shadow-cljs (142)
- # specter (2)
- # sql (16)
- # timbre (1)
- # vim (3)
@bozhidar: hey, sorry, not going to be able to debug this soon -- 'my-cider-test-on-test-last-sexp' works fine for me, and too lazy to learn how edebug works
OK, no problem. I was just really wondering how you and me could be getting a different behavior.
hi all, i was browsing the code in cider-nrepl (https://github.com/clojure-emacs/cider-nrepl/tree/v0.16.0) and I tried to follow the section "Or (if you know what you're doing) add cider-nrepl to your :dev :dependencies vector plus specific middleware to :nrepl-middleware under :repl-options" ... but my repl always fail to start with
Unable to resolve var: cider.nrepl.middleware.out/wrap-out in this context
my goal was to see if i can use the
wrap-out nrepl middleware from a Cursive Remote REPL
Can you try the same with 0.15? I’m curious if that’s some problem caused by the deferred middleware loading we introduced in 0.16.
the same applies to version
0.15.1 the repl starts .... but now when I connect from Cursive via a Remote REPL, the
*out* is not redirected to the Cursive output, do i need to do something extra?
btw, this setup just works with CIDER ... we're just a team where some people use Cursive and others CIDER, we get this nice feature and I was trying to make it work for the others 🙂
Well, there’s nothing specific about CIDER in any of the middleware, so I’m really puzzled by this.
Perhaps the real difference is that CIDER handles some messages it gets from nREPL differently.
Can you file a ticket about this in
cider-nrepl. I guess we might reconsider whether to provide some eagerly loaded versions of the middleware to address point 1 and think a bit more what’s wrong with the output handing in Cursive.
@bozhidar: because the horse isn't dead enough: I recently switched to:
so basically, my last version wasn't very stable either, I had to ahve the cursor right after the ")" otherwise, it had problem finding it too now, this new version is: search back regex for most recent ct/deftest ... run that 🙂
(defun my-cider-test-run-test-last-sexp () (interactive) (save-excursion (search-backward-regexp "ct/deftest") (evil-backward-char 1) (cider-test-run-test)))
Generally regexp search is bad idea, because sooner or later you run in a situation where this matches a text in a string or something like this.
i guess here's the thing; I can get away with this regex hack because the rest of cider is robust; if all of cider was based on regexes, we'd be f*cked
so I have situations where I do:
so now, my "last sexp" is the outer do, not the ct/deftest
(do ... (do ... (defn ... (ct/deftest ...)));;cursor here
But my general puzzlement continues to be you need to do something like this, as the current code works fine for me in the end of the test form and reading its code it was designed to work this - see the usage of
(defun cider-test-run-test () "Run the test at point. The test ns/var exist as text properties on report items and on highlighted failed/erred test definitions. When not found, a test definition at point is searched." (interactive) (let ((ns (get-text-property (point) 'ns)) (var (get-text-property (point) 'var))) (if (and ns var) ;; we're in a `cider-test-report-mode' buffer ;; or on a highlighted failed/erred test definition (progn (cider-test-update-last-test ns var) (cider-test-execute ns (list var))) ;; we're in a `clojure-mode' buffer (let ((ns (clojure-find-ns)) (def (clojure-find-def))) (if (and ns (member (car def) cider-test-defining-forms)) (progn (cider-test-update-last-test ns (cdr def)) (cider-test-execute ns (cdr def))) (message "No test at point"))))))
That’s why I really wanted just to see a stepping of this in the debugger to see what’s different for you.
what do you need from me? a screen capture / video? does it also need to show key presses
It’s really easy, btw - just
C-u C-M-x in the body of this function and then
n once it gets triggered.
so I don't know how to use debuggers, I just use unit tests / print statements, but let me try edebug, brb 5 mins
> what do you need from me? a screen capture / video? does it also need to show key presses
@qqq I saw what I needed. For some reason for you
clojure-find-def is returning
nil. Post this to the ticket and I’ll try to reproduce it with your code.
@bozhidar: I posted a 58 line init.el replicating the prolblem at https://github.com/clojure-emacs/cider/issues/2168 let me know if there's anything else I can provide
Seems might really be some problem with
clojure-find-def, but I wonder why this works for me.
yeah, if anyone else wants to learn edebug, just post a but @bozhidar can't replicate, and he'll teach you edebug for free 🙂
I also attached a 58 line init.el (most of it use-package), may be of use if you want to replicate issue locally
@bozhidar: still haven't fixed it? do I need to ship you a VM with a emacs replicating the bug? 🙂
actually, now that I mention it, funnily enough, ikt's possible to create a $5 digital ocean droplet, save the image, and share it, fasicnating how cloud changes things