Fork me on GitHub
#cider
<
2020-03-11
>
ak-coram08:03:51

@ryanwatkins54 I needed to set cider-jdk-src-paths for it to work

bozhidar08:03:22

As long as some Java sources are on your classpath the code lookup should work.

Joe Corneli13:03:12

I have gotten Drawbridge integrated into my app 🎉 ... and now I am wondering whether it's possible to get CIDER to connect to that.

Joe Corneli13:03:47

Looks like the relevant issue in the issue tracker is this one: https://github.com/clojure-emacs/cider/issues/39 currently closed as of 2014, last updated in 2017, so I guess the answer is "not without some work."

Joe Corneli13:03:36

The last comment in the thread there talks about something called Lein Catapult https://github.com/malyn/lein-catapult which seems like in principle it could be used

Joe Corneli13:03:20

It has one commit from six years ago, but hey, it's worth a try!

Joe Corneli14:03:13

Didn't work out of the box, but maybe it won't be too hard to debug. https://github.com/malyn/lein-catapult/issues/2

Joe Corneli14:03:12

However, that bug doesn't seem to matter, since if I rerun lein catapult :[email protected]:8080/repl I get a message that I am connected to Drawbridge!

Joe Corneli14:03:53

I've created a fork with modern dependencies [com.github.holtzermann17/lein-catapult "4fa2f909f334d2094b2885567f0f036da3518820"] via Jitpack, but I don't think this matters at the moment.

Joe Corneli14:03:32

OK, but now, trying to connect with CIDER I get the following print out:

Joe Corneli14:03:56

$ lein catapult :[email protected]:8080/repl
:repositories detected in user-level profiles! [:user] 
See 
Retrieving com/github/holtzermann17/lein-catapult/4fa2f909f334d2094b2885567f0f036da3518820/lein-catapult-4fa2f909f334d2094b2885567f0f036da3518820.pom from jitpack
Listening on port  33853 ; connected to Drawbridge.
nREPL connection accepted.
>>> {:op clone, :id 388}
>>> {:op clone, :id 389}
>>> {:op describe, :session ba6f45c9-8bc1-4e9b-8bf6-85c51fa10aec, :id 390}
<<< {:id 390, :session ba6f45c9-8bc1-4e9b-8bf6-85c51fa10aec, :aux {:current-ns user}, :ops {:describe {}, :eval {}, :load-file {}, :stdin {}, :clone {}, :interrupt {}, :close {}, :ls-sessions {}}, :versions {:nrepl {:major 0, :minor 6, :incremental 0, :version-string 0.6.0}, :clojure {:major 1, :minor 10, :incremental 0, :version-string 1.10.0}, :java {:major 11, :minor 0, :incremental 6, :version-string 11.0.6}}, :status [done]}
>>> {:file *cider-repl system-test/exchange:localhost:33853(clj)*, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :op eval, :column 1, :line 1002, :id 391, :code (clojure.core/apply clojure.core/require clojure.main/repl-requires), :content-type true, :inhibit-cider-middleware true, :nrepl.middleware.print/stream? 1, :nrepl.middleware.print/options {:right-margin 70}, :session ba6f45c9-8bc1-4e9b-8bf6-85c51fa10aec}

Joe Corneli14:03:55

CIDER still shows the loading symbols [=== ] [====] [ ===] [ ==] etc., and I don't get a prompt. However the cider-repl buffer does say this at the top:

;; Connected to nREPL server - 
;; CIDER 0.24.0 (package: 20200215.223) (India), nREPL 0.6.0

Joe Corneli15:03:13

I updated CIDER issue https://github.com/clojure-emacs/cider/issues/39 with this information. It looks like it is pretty close to working...

Joe Corneli15:03:56

Ah, here's an error message printed out by my app:

Joe Corneli15:03:14

Exception in thread "nRepl-session-ba6f45c9-8bc1-4e9b-8bf6-85c51fa10aec" java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Character (java.lang.String and java.lang.Character are in module java.base of loader 'bootstrap')

Joe Corneli16:03:47

Woah, I also see that despite being very slow more things are happening on the lein catapult repl if I leave if for a while.

>>> {:op eval, :code (seq (.split (System/getProperty "java.class.path") ":")), :session a7a5cfcd-d460-4924-9b8d-b4aa6eef7607, :id 6}
Followed by a big list with all of the dependencies in the app!
{:id 6, :session a7a5cfcd-d460-4924-9b8d-b4aa6eef7607, :ns user, :value ("/home/joe/system-test/exchange/test" "/home/joe/system-test/exchange/test/clj" "/home/joe/system-test/exchange/src/clj" ...  "/usr/local/lib/m2/viebel/codox-klipse-theme/0.0.1/codox-klipse-theme-0.0.1.jar")}

robert-stuttaford16:03:43

is there a way to have the *cider-result* buffer print newlines instead of the literal \n , inside an EDN output?

ag21:03:51

Somehow for some reason eldoc tips not showing up for me anymore. cider-eldoc-display-for-symbol-at-point and cider-eldoc-display-context-dependent-info are set to t. I have global-eldoc-mode enabled, but whenever I try to run M-x eldoc-mode it says: “There is no ElDoc support in this buffer”. Can someone help me to investigate why it’s not working?

dpsutton22:03:59

Are you running a custom built emacs? 27 or 28?

ag22:03:19

Ah… this is what I’m seeing: CIDER sets eldoc-documentation-function but eldoc-documentation-functions is nil, that prevents eldoc from enabling the mode in the buffer

ag22:03:41

@dpsutton yes I’m running 28, because I want jansson support

dpsutton22:03:06

Well it sounds like you’re on your way. I think I heard this api changed in 28

ag22:03:24

> Well it sounds like you’re on your way Not really. I’m still not sure how to fix this

ag22:03:36

Nevermind. Fixed it by doing (add-hook 'eldoc-documentation-functions #'cider-doc nil t)