This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-11
Channels
- # adventofcode (116)
- # aleph (10)
- # announcements (2)
- # beginners (67)
- # boot (3)
- # calva (17)
- # cider (8)
- # cljdoc (27)
- # cljsrn (6)
- # clojure (144)
- # clojure-austin (3)
- # clojure-boston (1)
- # clojure-dev (25)
- # clojure-europe (4)
- # clojure-italy (26)
- # clojure-losangeles (4)
- # clojure-nl (28)
- # clojure-russia (1)
- # clojure-uk (34)
- # clojurescript (130)
- # cursive (20)
- # datomic (69)
- # emacs (14)
- # figwheel-main (2)
- # fulcro (31)
- # graphql (3)
- # hyperfiddle (3)
- # jobs (1)
- # jobs-discuss (1)
- # kaocha (1)
- # leiningen (2)
- # lumo (2)
- # nrepl (1)
- # off-topic (182)
- # onyx (5)
- # re-frame (88)
- # reagent (12)
- # reitit (2)
- # ring-swagger (13)
- # shadow-cljs (136)
- # tools-deps (28)
- # vim (4)
Is there an overview of how people can get a REPL in their editor for a deps.edn based project (without adding nREPL-specific deps to the deps.edn, so by setting up an alias in their profile)?
Here’s my cider-nrepl
alias, FWIW:
:cider-nrepl {:extra-deps {nrepl/nrepl {:mvn/version "0.4.5"}
cider/cider-nrepl {:mvn/version "0.18.0"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}
I start my REPL by doing clojure -A:cider-nrepl
and then connect CIDER to it via cider-connect
. I think that any nREPL-aware editor could do the same?
I do the same the ClojureScript one is very similar
More info here: https://nrepl.xyz/nrepl/usage/server.html
Yep well cider is just a middleware. Also keep in mind that Calva for VSCode does use the cider Middleware
I’d like to link to something like that in https://github.com/borkdude/advent-of-cljc
@borkdude The problem with using an alias that sets "-m" "nrepl.cmdline"
is that it doesn't allow you to also specify -r
or -m rebel-readline.main
To me an nREPL-connected editor is only one part - the other part is a terminal/rebel-readline based prompt
That could be solved if nrepl.cmdline supported a --next-main
or --chain
argument, like --chain rebl-readlin.main
. What it would do is to spawn the server in the background and then call the next main function
It could even do clean-up when that chained main exits
@alexmiller has mentioned a start
option, which could be in the same area
+1 for that. I never got to try it but I think you can combine -e to evaluate something arbitrary with -m ?
yes you can -e something
-e something-else
-m some.main
, though -m
must be last
but those don't work if the settings are specified in different aliases - the latter alias will override the earlier one
A colleague of mine ran into this: https://github.com/gfredericks/user.clj, maybe one could start nrepl server at load of user.clj?
yes, a library could be used for this purpose
@pesterhazy cool, if you have anything better to link to, I would update the README with it