clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
jasonbell 2021-06-18T04:42:46.321500Z

Morning

dharrigan 2021-06-18T06:02:59.321700Z

Good Morning!

Aron 2021-06-18T06:53:21.321900Z

morngn

mccraigmccraig 2021-06-18T08:00:49.322200Z

mawning

thomas 2021-06-18T08:01:28.322400Z

mogge

alexlynham 2021-06-18T08:10:24.322600Z

morning

Jakob Durstberger 2021-06-18T08:21:47.322800Z

Happy rainy Friday 🙂

dharrigan 2021-06-18T08:23:36.323100Z

:umbrella_with_rain_drops:

yogidevbear 2021-06-18T08:29:59.323400Z

Morning 🙂

2021-06-18T08:48:55.323600Z

Morn'

dharrigan 2021-06-18T09:46:20.324200Z

Does anyone use leiningen with rebel-readline and have a nrepl server running?

dharrigan 2021-06-18T09:56:21.325600Z

it's a fancy terminal for interactive input that does things like tab completion, colourised output, highlighting, history,

dharrigan 2021-06-18T09:57:00.326200Z

command history, multi-line editing, syntax colouring etc..

dharrigan 2021-06-18T09:57:10.326600Z

I use it with deps, but not with leiningen

mccraigmccraig 2021-06-18T09:57:15.326800Z

oh, nice - that sounds like i would use that - particularly multi-line editing

dharrigan 2021-06-18T09:58:01.327500Z

Practicalli did a small video on it a while agao <https://www.youtube.com/watch?v=U19TWMsg0s0>

mccraigmccraig 2021-06-18T09:58:22.327800Z

i've often got a terminal repl running alongside a CIDER session, 'cos i don't find multiple concurrent CIDER sessions that great an experience

dharrigan 2021-06-18T09:59:12.328700Z

I too have it running, but I'm working on a project that uses lein, so just seeing if anyone had it running. It does work, but it prevents nrepl from starting (not because of a bug or whatnot, but simply it doesn't understand how to)

dharrigan 2021-06-18T09:59:28.328900Z

with clojure deps, it's dead simp

mccraigmccraig 2021-06-18T13:05:29.329800Z

did you figure it out @dharrigan? i'm repling on a server atm, and it would actually be really handy to have multi-line editing

dharrigan 2021-06-18T13:07:32.330900Z

I've decided to take the approach of maintaining my own deps.edn and migrating the project.clj to that 🙂 (keeping the existing lein configuration)

dharrigan 2021-06-18T13:08:13.331400Z

So, you could said I abandoned the attempt to get it to work with lein, instead, I'm using my proven way of deps.edn

mccraigmccraig 2021-06-18T13:14:18.332Z

oh well 😢 . i'd like to switch to deps.edn, but it's going to be so painful

2021-06-18T15:52:00.332800Z

@dharrigan I have all of that running on most of my projects, I don't believe it cases any conflicts...

dharrigan 2021-06-18T15:52:28.333Z

?

2021-06-18T15:53:17.333700Z

Is there an issue you're seeing 😃?

dharrigan 2021-06-18T15:53:55.334100Z

I prerhaps didn't explain myself well...

dharrigan 2021-06-18T15:53:56.334300Z

if you have this:

dharrigan 2021-06-18T15:54:04.334500Z

❯ cat profiles.clj                                  
{:user {:dependencies [[com.bhauman/rebel-readline "0.1.4"]]
        :plugins [[cider/cider-nrepl "0.26.0"]]
        :aliases {"rebel" ["trampoline" "run" "-m" "rebel-readline.main"]}}}

dharrigan 2021-06-18T15:54:22.335100Z

in your profiles.clj for lein, and you do this lein rebel, no nrepl server is started

dharrigan 2021-06-18T15:54:31.335400Z

where as, if you simply do lein repl then it is

dharrigan 2021-06-18T15:55:28.335800Z

I don't use lein that much (mostly been a deps guy from day one)

dharrigan 2021-06-18T15:55:41.336200Z

so I don't know how it is possible to start up rebel and the nrepl server too

2021-06-18T16:01:43.338100Z

Hmm, they coexist nicely in the same project. It's just normally I use rebel for the command line and nrepl for connecting to cursive. I do start up sessions with lein repl. Practicalli seems to be able to do it:

For a rich terminal REPL experience, start the REPL with rebel readline as well as nREPL and CIDER libraries.
clojure -M:repl/rebel-nrepl
From here: <https://practical.li/spacemacs/clojure-repl/connect-to-remote-repl.html>

dharrigan 2021-06-18T16:02:10.338400Z

right, so that's a project.clj and a deps.edn being used

dharrigan 2021-06-18T16:02:33.338700Z

I think it would be possible to do, for I do something similar with deps..

dharrigan 2021-06-18T16:03:04.339Z

As part of my "boot" of clj, I have this

dharrigan 2021-06-18T16:03:06.339200Z

(defn start-nrepl
  [env-port]
  (let [server-map (nrepl/start-server
                    :port (or env-port 0)
                    :handler (apply nrepl.server/default-handler
                                    (-&gt; (map #'cider.nrepl/resolve-or-fail cider.nrepl/cider-middleware)
                                        (conj #'refactor-nrepl.middleware/wrap-refactor))))
        port (:port server-map)
        port-file (io/file ".nrepl-port")]
    (.deleteOnExit port-file)
    (spit port-file port)
    (println (ansi/green (str "nREPL client can be connected to port " port)))))

dharrigan 2021-06-18T16:03:14.339500Z

so I programmatically start the nrepl server

dharrigan 2021-06-18T16:03:25.339800Z

I guess I can do the same in a user.clj on the lein project

dharrigan 2021-06-18T16:03:52.340300Z

but <shrug>, might as well just convert the project.clj to deps.edn (which I've done as a POC) and it works grand