This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-18
Channels
- # architecture (25)
- # beginners (57)
- # boot (3)
- # cider (38)
- # clara (6)
- # cljsrn (6)
- # clojure (54)
- # clojure-china (4)
- # clojure-greece (1)
- # clojure-italy (3)
- # clojure-romania (1)
- # clojure-russia (7)
- # clojure-spec (68)
- # clojure-uk (46)
- # clojurescript (73)
- # community-development (2)
- # core-async (7)
- # cursive (17)
- # datomic (143)
- # duct (2)
- # emacs (12)
- # events (5)
- # figwheel (3)
- # fulcro (15)
- # hoplon (19)
- # jobs (12)
- # jobs-discuss (85)
- # nginx (3)
- # off-topic (111)
- # onyx (7)
- # other-languages (1)
- # re-frame (30)
- # reagent (19)
- # remote-jobs (1)
- # ring (7)
- # rum (1)
- # shadow-cljs (18)
- # spacemacs (4)
- # specter (4)
- # sql (24)
- # test-check (1)
- # unrepl (10)
- # vim (6)
- # yada (1)
@bozhidar: do you expect the tests for cider-nrepl
to work when invoked in cider itself? In particular, I’m getting failures in cider.nrepl.middleware.debug-integration-test
if I visit the file and C-c C-k
followed by C-c C-t C-n
. The failing cases all sit inside step-in-to-function-in-current-project-test
.
The failures look very similar (might be identical?) to the test failures when run with cloverage
. Tests in that namespace do not fail when run like lein with-profile +1.8,+test-clj test
@dpsutton, thanks, I’ll keep that in mind but it doesn’t seem to be the same issue.
Running just the one namespace’s tests fails like so…
$ lein with-profile +1.8,+test-clj test cider.nrepl.middleware.debug-integration-test
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cider.nrepl/wrap-debug in this context, compiling:(cider/nrepl/middleware/debug_integration_test.clj:29:3)
but if I edit (:require [cider.nrepl :refer [wrap-debug]])
in that namespace, then
$ lein with-profile +1.8,+test-clj test cider.nrepl.middleware.debug-integration-test
lein test cider.nrepl.middleware.debug-integration-test
Ran 11 tests containing 181 assertions.
0 failures, 0 errors.
Actually, the problem might be a classpath thing. I could probably use a hint on this… This test step-in-to-function-in-current-project-test
describes its purpose as
;; We want to ensure that the debugger can find and instrument the code of a
;; function that lives in a regular file on the classpath (as opposed to,
;; for example, in a jar, which is tested later).
And the first case to fail is
(--> :eval "(ns user.test.step-in
(:require [cider.nrepl.middleware.debug-integration-test.fn :as test-fn]))")
(<-- {:ns "user.test.step-in"})
The ns
fails because Message: {:ex "class java.io.FileNotFoundException", :id 486, :root-ex "class java.io.FileNotFoundException", :session "2e4b5c11-8c2c-4f98-b5f5-3c568568b077", :status ["eval-error"]}
Which I am interpreting as (maybe?) a failure to find cider/nrepl/middleware/debug_integraton_test/fn.clj
There’s a comment in the code that says literally “you cannot use the cider debugger to debug these tests :(” because the debugger has mutable global state that makes it impossible to isolate the debugging session’ from the tests.
Nevermind. I wasn’t specifying the right profiles for cider-jack-in
.
And way too many Lein profiles - I don’t even remember at this point why the default lein
profile for cider-nrepl
isn’t including anything. As I told you - there’s a ton of potential for cleanup and improvement there.
Hi, I'm working on a project which uses http-kit
. Whenever I start a server I can instrument functions and debug them by sending requests to the server, which is very nice 🙂. However whenever a press c
to continue, the debugger no longer halts on future request and I end up having to restart my repl and server. Is there any way around that?
how do I tell cider-doc
to ignore cider-prompt-for-symbol
and just always use the symbol under point ?
this function is amazing, saves all the chrome -> google -> clojuredocs "func name" searches
> how do I tell cider-doc
to ignore cider-prompt-for-symbol
and just always use the symbol under point ?
Just keep in mind that’s going to affect all commands, not just cider-doc
. Generally people want to same behavior across all similar commands.
> Hi, I’m working on a project which uses http-kit
. Whenever I start a server I can instrument functions and debug them by sending requests to the server, which is very nice 🙂. However whenever a press c
to continue, the debugger no longer halts on future request and I end up having to restart my repl and server. Is there any way around that?
@wopeers I think that was some known, but inconsistent bug. If you can reproduce it reliably feel free to file a ticket.
Perhaps de-instrumenting the function and instrumenting it again will work as some workaround.
You can just define some wrapper function like this:
(defun my-cider-doc ()
(let ((cider-prompt-for-symbol nil))
(cider-doc...
Just a vague sketch using dynamic bindings to change the behaviour of the function you wrap - might be odd for Clojure devs, but it’s very common in Emacs Lisp.
Btw, @qqq take a look at my response here https://github.com/clojure-emacs/cider/issues/2168
Btw, while debugging this I noticed that we weren’t highlighting test assertions that were defined interactively and failed, so at least I fixed this. 😄