This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-30
Channels
- # babashka (44)
- # beginners (29)
- # calva (80)
- # cider (11)
- # clara (1)
- # clj-kondo (9)
- # clojure (80)
- # clojure-europe (21)
- # clojure-france (13)
- # clojure-nl (4)
- # clojure-spec (3)
- # clojure-uk (6)
- # clojurescript (72)
- # code-reviews (43)
- # cursive (11)
- # datomic (27)
- # events (13)
- # figwheel-main (12)
- # fulcro (27)
- # graalvm (1)
- # jackdaw (2)
- # kaocha (1)
- # malli (4)
- # meander (13)
- # nrepl (2)
- # pathom (8)
- # re-frame (4)
- # reagent (7)
- # reitit (9)
- # remote-jobs (1)
- # reveal (56)
- # ring-swagger (2)
- # sci (5)
- # shadow-cljs (20)
- # slack-help (2)
- # tools-deps (96)
- # vim (7)
- # xtdb (32)
When I have a tools-deps alias which has -m any.cool.class
as main-opts the cursive nrepl seems to ignore those, when started with that alias. Am I doing something wrong or is this intended behaviour?
how does your run configuration look like exactly?
maybe u can just paste the corresponding XML here from your .idea/runConfiguration
or .run
folder
Sure.
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="CLJ REPL" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false">
<module name="meetly" />
<setting name="replType" value="NREPL" />
<setting name="execution" value="DEPS" />
<setting name="jvmArgs" value="-Dghostwheel.enabled=true" />
<setting name="parameters" value="" />
<setting name="workingDir" value="$PROJECT_DIR$" />
<setting name="profiles" value="" />
<setting name="aliases" value="run-server" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
</component>
The run-server alias has a main-opt -m project.server
. Its main is never executed. I even put non-existing function-calls in to see if it breaks. But it does not run at all.When i do clj -A:run-server
it works just fine. But of course I would like to have it inside of my nrepl
okay, so this is a Local nREPL config. IntelliJ have to tell your app to start an nREPL server, so the IntelliJ process can connect and talk to it.
when u start it from the command line, there is no need for a server, because your application process is accepting input from the stdin directly
if u click on the line which appears at the top of your Cursive REPL window, it should expand to a very long command line.
at the end of that command-line, there is a -i <some/randomly/named.clj>
.
that is the program which executes first and enters an nREPL server loop.
because of that, no other code has the chance to interpret the -m
option from the command-line.
Thanks, so there is no option to start the -main
function inside the newly created nrepl, except of doint it by hand then?
im not sure i understand that question, but at the same time im not sure i can explain it more precisely either.
how i understood this was by reading the source code of clojure.main/-main
https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj#L616-L674
which is referenced from this java entry point:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/main.java#L23