Fork me on GitHub
#cider
<
2022-08-11
>
Martynas Maciulevičius07:08:21

Hey. The docs of cider-nrepl say that test is deprecated: https://github.com/clojure-emacs/cider-nrepl/blob/389cc1bf126134f941030a1c8343c1384f19eeb5/src/cider/nrepl.clj#L452. What is it replaced with? Could docs say which function should be used instead? Also I'm digging into CIDER source code and it's hard to understand what are the inputs and what are the actual API calls that are intended. Any examples? Also CIDER seems to use the deprecated test function: https://github.com/clojure-emacs/cider/blob/dd4c555fd88834581306ac54f1aaefe2b0efec99/cider-test.el#L663 I want to test the current namespace from REPL and get results (I expect to add it as Leiningen dependency and simply execute the test somehow).

Martynas Maciulevičius08:08:51

I tried this but it didn't work:

((cider.nrepl/wrap-test :hi)
 {:op "test-all"
  :session :hi
  :namespace *ns*})

dpsutton11:08:40

I'd suggest the easiest way to get the exact message is to start a sample project, turn on nrepl logging, and see what message it sends for test all

Martynas Maciulevičius12:08:44

Nice. I didn't know it was a thing. But now there is a problem because CIDER uses "test" which is marked in code as deprecated:

(-->
  id         "88"
  op         "test"
  session    "dca8aa06-8163-49af-be06-0d0e0b9ad605"
  time-stamp "2022-08-11 15:47:00.045844547"
  load?      "true"
  ns         #("_-test" 0 42 (fontified t help-echo cider--help-echo cider-locals nil cider-block-dynamic-font-lock t face font-lock-type-face))
  tests      ("_-test")
)
And I somehow need to understand how to make a session.

Martynas Maciulevičius14:08:10

I managed to see the log and describe the session of my other nREPL connection but it gives me this short list of operations: add-middleware,load-file,swap-middleware,ls-middleware,close,sideloader-provide,stdin,sideloader-start,lookup,clone,ls-sessions,completions,eval,describe,interrupt And in CIDER it gives me very many more. It also gives the version of the nREPL plugin. Any ideas what could it be? Maybe it's somehow the type of the connection? They reply with this list for me: https://github.com/clojure-emacs/cider-nrepl/blob/a8fd4f929844c42f3c4700dcc95a719c2d645e72/maint/cider/nrepl/impl/docs.clj#L44

dpsutton14:08:52

cider has more middleware. Did you add the cider-nrepl to your nrepl session?

dpsutton14:08:01

I think reading the docs would be very helpful if you haven’t

Martynas Maciulevičius14:08:06

I'm trying to run Conjure and I want to find out how it connects to REPL. And it doesn't have some functionality so I think how to make it work. I haven't touched any docs. I'll try them.