cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
quoll 2021-05-25T20:55:46.019300Z

Recently, I’ve been using Emacs and Cider a bit more, so I’ve been wondering about clearing a warning that I get when I try cider-jack-in for a leiningen project, and allow cider to start leiningen: > WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (https://docs.cider.mx/cider/1.1/troubleshooting.html#cider-complains-of-the-cider-nrepl-version) Note, I don’t know much about either emacs, or Cider. Emacs has Cider 1.1.1 installed. The “More information” link is for the troubleshooting subsection: CIDER complains of the `cider-nrepl` version. This is a similar, though different, warning. But assuming that it’s about right, then I’m thinking that the subsection I’m interested in is: > https://docs.cider.mx/cider/1.1/troubleshooting.html#you-see-not-installed-or-nil-and-youre-starting-the-repl-with-cider-jack-in You see `not installed` or `nil`, and you’re starting the REPL with `cider-jack-in` • cider-inject-dependencies-at-jack-in is set to t • My project uses Clojure 1.10.3 • Leiningen is 2.9.6 There is also the suggestion of configuring cider-nrepl myself (my understanding was that this should be brought in automatically though, is that right?). Anyway, I added into my :plugins section:

:plugins [[cider/cider-nrepl "0.26.0"]]
However, I continue to get the warning. Does anyone have a suggestion of where I can learn enough to address this please?

dpsutton 2021-05-25T21:05:07.019800Z

@quoll at the start of the repl should be a startup form. can you paste that here (love your work by the way)

quoll 2021-05-25T21:05:43.020300Z

;;  Startup: /usr/local/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"0.8.3\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.26.0\"\] -- repl :headless :host localhost
… and thank you 🙂

dpsutton 2021-05-25T21:07:17.020600Z

can you see what (apropos "cider") returns?

dpsutton 2021-05-25T21:07:50.021300Z

identifying the source of the error: either it's correctly not seeing cider-nrepl or it's incorrectly saying cider-nrepl is not available when it is available

dpsutton 2021-05-25T21:08:33.021800Z

(any chance you have a locally installed version of cider-nrepl? ie, lein install from a local copy of it?)

quoll 2021-05-25T21:09:19.022200Z

I doubt it, but if I did it would have been from years ago

quoll 2021-05-25T21:09:52.022400Z

what would I be looking for?

quoll 2021-05-25T21:10:03.022700Z

BTW, the result of the apropos was: ()

dpsutton 2021-05-25T21:11:29.024300Z

ok so it seems like cider-nrepl is not around. if you copy that startup script, run it from a terminal, can you try to cider-connect to it and see if you get the same warning?

quoll 2021-05-25T21:11:40.024600Z

It took a while because after updating to Cider 1.1.1 (I was on an older one until 30 minutes ago), my cider repl no longer includes clojure.core nor clojure.repl. Very annoying, but I can work around it

dpsutton 2021-05-25T21:13:27.024800Z

very weird

dpsutton 2021-05-25T21:14:01.024900Z

here i used that same startup command (without the headless and host part) and checked if cider was around

dpsutton 2021-05-25T21:14:45.025500Z

what do you mean it no longer includes clojure.core nor clojure.repl?

dpsutton 2021-05-25T21:15:04.026Z

like evaluating (defn foo []) reports an error that defn is undefined?

quoll 2021-05-25T21:15:15.026200Z

OK… after connecting I get the same warning

quoll 2021-05-25T21:15:23.026400Z

and yes

dpsutton 2021-05-25T21:15:41.027Z

ok. that part sounds like you did (in-ns 'some-namespace-not-required-yet) but not positive

quoll 2021-05-25T21:16:16.027900Z

After the cider-connect I have access to clojure.core

dpsutton 2021-05-25T21:16:17.028Z

any chance you have a profiles.clj file in your lein directory in your home dir?

quoll 2021-05-25T21:16:33.028100Z

yes, I do

dpsutton 2021-05-25T21:16:50.028300Z

does it have some old junk laying around, maybe a conflicting version of cider-nrepl?

quoll 2021-05-25T21:17:20.028500Z

no… but I just realized that I have :implicit-middleware false

dpsutton 2021-05-25T21:18:08.028700Z

that sounds ... like a likely culprit but i've never heard of it before lol

quoll 2021-05-25T21:18:19.028900Z

I removed it and it worked! Yay!

dpsutton 2021-05-25T21:18:35.029100Z

if you restore it and add the plugin directly into your project.clj i suspect it will work?

quoll 2021-05-25T21:18:48.029300Z

I put it in blindly a long time ago when some other package wanted it for some reason

dpsutton 2021-05-25T21:18:52.029500Z

not sure where you security preferences are now if you want that enabled, but if so, i bet you can get around it

dpsutton 2021-05-25T21:19:02.029700Z

awesome. well sounds like that feature works 🙂

dpsutton 2021-05-25T21:19:16.029900Z

congrats on your strange loop talk!

quoll 2021-05-25T21:19:26.030100Z

When it was in I was explicitly include cider-nrepl and that wasn’t helping

dpsutton 2021-05-25T21:19:37.030300Z

yeah that's a bit strange to me

quoll 2021-05-25T21:19:49.030500Z

Thank you. I’m only panicking a bit so far

dpsutton 2021-05-25T21:20:01.030700Z

i wonder if there's a bug when you "implicitly" include a plugin if it denies that plugin from being used, even if you directly depend on it as well

dpsutton 2021-05-25T21:20:27.031Z

your last talk on graph databases went really well so i'm sure you'll do really well again 🙂

quoll 2021-05-25T21:20:37.031200Z

I don’t know. I can’t tell you which package suggested that I configure this too

quoll 2021-05-25T21:20:49.031400Z

Oh, the :clojureD talk?

dpsutton 2021-05-25T21:21:08.031600Z

yeah. i built a repl history that would collect all forms and throw them into asami with your help

dpsutton 2021-05-25T21:21:22.031800Z

so you could query for all history that used a particular form, etc

quoll 2021-05-25T21:21:25.032Z

oh, cool 🙂

dpsutton 2021-05-25T21:21:34.032200Z

you did all the heavy lifting 🙂

quoll 2021-05-25T21:21:46.032400Z

I’m finding Asami is helping me with lots of things now 🙂

quoll 2021-05-25T21:24:06.032600Z

Someone wanted to load a pcap file (packet capture) in JSON format, but his edn was failing due to some attributes having spaces in them. I’ve removed data checking now, so you can just load raw JSON if you want. So then I could do queries to find all the attributes, and filter them (in the query) by regex to give me the ones with spaces.

quoll 2021-05-25T21:24:43.032800Z

Maybe it’s because I’m used to graph thinking now, but I found it much easier to query the data than to process seq of maps that were embedded to arbitrary depth!

quoll 2021-05-25T21:25:20.033Z

It feels icky to have string attributes, but… hey, it works! 🙂

quoll 2021-05-25T21:25:36.033300Z

Thank you so much for the help!

dpsutton 2021-05-25T21:26:40.033400Z

yeah. at some point you need a proper query. sounds really cool

quoll 2021-05-25T21:34:47.033600Z

(require '[asami.core :as d])
(require '[cheshire.core :as json])
(def conn (d/connect "asami:<mem://data>"))
(def tx @(s/transact conn {:tx-data (json/parse-string (slurp "/path/to/file.json"))}))

(d/q '[:find (count ?a) . :where [?e ?a ?v]] conn)
(d/q '[:find [?a ...] :where [?e ?a ?v] [(re-find #" " ?a)]] conn)

quoll 2021-05-25T21:35:11.033800Z

Those last 2 queries told me how many attributes were in his json, and which ones had strings with spaces in them

dpsutton 2021-05-25T21:35:28.034100Z

lovely

dpsutton 2021-05-25T21:36:02.034300Z

i had need of a triple store in cljs recently. a really simple no-logic-engine, just assert triples and missed having something like this around

quoll 2021-05-25T21:36:25.034500Z

my colleagues were constantly creating convenience functions that accepted connections and called d/db on it before sending it to the query. So now queries accept connections and do that step implicitly

quoll 2021-05-25T21:36:39.034700Z

Well, it’s free. 🙂

quoll 2021-05-25T21:36:55.034900Z

And if anything goes wrong, I know a woman who can help

🎉 1
quoll 2021-05-25T21:40:59.035200Z

I think I discovered why I couldn’t access clojure.core a few minutes ago

quoll 2021-05-25T21:41:54.035400Z

I think I used C-c M-n M-n to set the namespace in my repl, but I had not used C-c C-k to load it

dpsutton 2021-05-25T21:42:52.035600Z

yup

dpsutton 2021-05-25T21:43:03.035800Z

which does an in-ns before require

dpsutton 2021-05-25T21:43:11.036Z

my muscle memory got used that one quit

dpsutton 2021-05-25T21:43:14.036200Z

quick

quoll 2021-05-25T21:43:35.036400Z

Thank you for all the help. I’d just have been as stuck as ever

dpsutton 2021-05-25T21:44:06.036600Z

absolutely my pleasure