This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-22
Channels
- # ai (1)
- # announcements (4)
- # babashka (23)
- # beginners (27)
- # biff (17)
- # calva (5)
- # clerk (6)
- # clj-commons (27)
- # clj-kondo (35)
- # clojars (12)
- # clojure (27)
- # clojure-denver (3)
- # clojure-europe (71)
- # clojure-norway (7)
- # clojure-spec (5)
- # clojure-uk (2)
- # clojurescript (45)
- # data-science (9)
- # datomic (4)
- # dev-tooling (2)
- # devcards (1)
- # hoplon (2)
- # hyperfiddle (36)
- # introduce-yourself (3)
- # malli (11)
- # missionary (2)
- # off-topic (63)
- # polylith (5)
- # rdf (2)
- # reagent (12)
- # schema (1)
- # shadow-cljs (11)
- # sql (6)
- # tools-deps (23)
- # xtdb (6)
I’m quite new to Clojure. Trying Biff. I’m using vim with vim-iced plugin. How can I connect to nREPL started by bb dev
from vim?
If I JackIn with :IcedJackIn and try to execute some function (like (seed-channels)
from Biff tutorial, I get the following error:
Execution error (IllegalArgumentException) at xtdb.api/eval27282$fn$G (api.clj:351).
No implementation of method: :db of protocol: #'xtdb.api/DBProvider found for class: nil
Looks like :IcedConnect 7888
is what you want. :IcedJackIn
will start its own nrepl server instead of connecting to bb dev
's nrepl server. That error message gets thrown because in the :IcedJackIn
process, the system hasn't been started, so the :biff.xtdb/node
key in the system map is nil, hence ... found for class: nil
https://liquidz.github.io/vim-iced/vim-iced.html#%3AIcedConnect
:IcedConnect 7888
was my first try, but it gives me an error:
iced-nrepl is not enabled. Please launch repl with the `iced repl` command.
I also tried :IcedConnectSocketRepl 7888
and it says Connected
, but then no evaluation happens when I try something (even (+ 1 2)
). I love Clojure, but tooling is difficult for beginners :(
Well, when I do IcedConnect 7888
it gives me a message
iced-nrepl is not enabled. Please launch repl with the `iced repl` command.
but looks like it does conncet to nrepl as I can evaluate expressions. But I cannot get the context with (biff/assoc-db @main/system)
- it gives an error
Execution error (IllegalArgumentException) at xtdb.api/eval27282$fn$G (api.clj:351).
No implementation of method: :db of protocol: #'xtdb.api/DBProvider found for class: nil
Got it! I had another clojure repl running in a separate terminal :man-facepalming: and this somehow interfered with nrepl, I suppose. When I stopped it, everything works now! Uh..
A while back I had a problem getting bb dev
and vim-iced to work together and if I remember correctly, the solution was to add iced.nrepl/wrap-iced
to the "--middleware"
arg in :biff.tasks/clj-args
. So it ended up looking a bit like this:
:biff.tasks/clj-args ["-J-XX:-OmitStackTraceInFastThrow"
"-J-XX:+CrashOnOutOfMemoryError"
"-M" "-m" "com.example"
"--port" "7888"
"--middleware" "[cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor,iced.nrepl/wrap-iced]"]
Oops, should've mentioned this is all in config.edn
.
Yes, I found it. And your suggestions look promising indeed. But I get an error when put iced.nrepl/wrap-iced
in:
Execution error (FileNotFoundException) at nrepl.cmdline/require-and-resolve (cmdline.clj:220).
Could not locate iced/nrepl__init.class, iced/nrepl.clj or iced/nrepl.cljc on classpath.
Could you suggest what’s wrong?
P.S. And yes, I do need to fix it somehow, as I managed to connect to bb dev nrepl once somehow, but it does not work for me again now.Added com.github.liquidz/iced-nrepl {:mvn/version "1.2.480"}
to deps.edn and looks like all works well now again. Thanks @U03RJ0AMUS1!
Ah yes! I forgot that part, too! I'm very happy it's working now!
ah glad it's all working! might not hurt to put some of that info in a gist and link to it from the docs...
@U7YNGKDHA, I created a gist. You can copy it to your own gists if you want. @U03RJ0AMUS1, all the credits should be yours, how should I refer you on github? https://gist.github.com/avitkauskas/88ddc3c9b297f431143e22f36a224459
BTW, @U7YNGKDHA would you consider adding dependency of iced-repl and its middleware wrapper into your example application template (perhaps commented out or something, with the remark for vim-iced users to uncomment it)? On the other side, I do not need cider.nrepl/cider-middleware and refactor-nrepl.middleware/wrap-refactor wrappers as I do not use Emacs. I could make a PR if you wish.
Thanks--just added a link to the gist in the https://biffweb.com/docs/get-started/new-project/ and in the https://biffweb.com/docs/library/. As for including it in deps.edn, I think better to just leave it as separate documentation. The cider middleware I think makes sense to include because it's used by https://github.com/clojure-emacs/cider-nrepl#cider-nrepl, not just emacs:
> cider-nrepl
is also used by vim-fireplace
, iced-vim
, Calva and other Clojure development tools based on nREPL.
(Apparently iced-vim uses it too 🤷 )
Hey, thanks @U05E4BRHBCG! I'm Epidiah just about everywhere, including github: https://github.com/Epidiah But I'm pretty sure I was just relaying some info given to me when I asked a similar question in this channel a few months ago. So I can't really take the credit.