Every time I paste something in, my entire file is auto-indented. Does anyone know how to turn that off? I have aggressive-indent-mode
turned off.
If this isn't a cider thing, let me know and I'll ask over in #emacs.
Not aware of anything in cider that would do that
Might be some advice to reformat on pasting.
It's certainly not coming from CIDER, though.
is there a way to jump to core library code in cider or library code ?
so if my cursor is on db/query I want to peak the fn to see what its doing
Sure, cider-find-var
does that.
ah cheers exactly what i want, who would have thought find var to find a function 😛
Bound to M-. usually
yeah I just added it to a hydra under ? and labelled it "Show src" else i will be back asking again in a few months 🙂
Hello. I’m facing a problem similar to the one in this ticket: https://github.com/clojure-emacs/cider/issues/2237
However, I’m on
;; CIDER 0.25.0snapshot (package: 20200602.710), nREPL 0.7.0
;; Clojure 1.10.1, Java 14.0.2
I’m using Spacemacs
I evaluate anything that throws an exception and the dialog shows up 1 second later, maybe more
I’ve accidentally ended up exiting emacs a few times as a consequence 🙂
Does anybody have a suggestion other than upgrading packages? That is a last resort…
Ah, alright, Ignore, I gave up and upgraded, the Cider version certainly seemed old. Seems to have fixed it
Hello, I use emacs/cider and have a clojurescript project build with shadow cljs. I connected to the nrepl server, but I'm not able to send s-expressions to
the repl with C-c C-e
like I normally do. Can anybody help me with this?
what happens when you hit C-c C-e
?
nothing it just hangs
I use doom emacs if this helps
just to add I'm a emacs noob 😇
is this a webapp? If so, evaluate (js/alert "HI")
to prove you're actually in a cljs repl
this works after i switch the namespace (shadow.cljs.devtools.api/repl :app)
but C-c C-e
still does nothing
how did you connect? cider-connect-cljs
and then chose shadow-select
?
cider-connect-cljs
and then select host +port
and how did you start shadow?
shadow-cljs watch app
and do you have cider-nrepl in your deps?
also, is this a :deps true
type project?
no but i have a deps project in the same folder
i also get some errors on shadow start
[:failed-to-compare "^17.0.1" "17.0.1" #error {
:cause "Cannot invoke \"Object.getClass()\" because \"target\" is null"
:via
[{:type java.lang.NullPointerException
:message "Cannot invoke \"Object.getClass()\" because \"target\" is null"
:at [clojure.lang.Reflector invokeInstanceMethod "Reflector.java" 97]}]
:trace
[[clojure.lang.Reflector invokeInstanceMethod "Reflector.java" 97]
[shadow.cljs.devtools.server.npm_deps$make_engine invokeStatic "npm_deps.clj" 39]
[shadow.cljs.devtools.server.npm_deps$make_engine invoke "npm_deps.clj" 32]
[shadow.cljs.devtools.server.npm_deps$fn__15774$fn__15775 invoke "npm_deps.clj" 46]
[clojure.lang.Delay deref "Delay.java" 42]
[clojure.core$deref invokeStatic "core.clj" 2320]
[clojure.core$deref invoke "core.clj" 2306]
[shadow.cljs.devtools.server.npm_deps$fn__15774$fn__15777 invoke "npm_deps.clj" 52]
[shadow.cljs.devtools.server.npm_deps$is_installed_QMARK_ invokeStatic "npm_deps.clj" 219]
[shadow.cljs.devtools.server.npm_deps$is_installed_QMARK_ invoke "npm_deps.clj" 213]
[shadow.cljs.devtools.server.npm_deps$main$fn__15867 invoke "npm_deps.clj" 239]
[clojure.core$complement$fn__5669 invoke "core.clj" 1441]
[clojure.core$filter$fn__5893 invoke "core.clj" 2821]
[clojure.lang.LazySeq sval "LazySeq.java" 42]
[clojure.lang.LazySeq seq "LazySeq.java" 51]
[clojure.lang.RT seq "RT.java" 535]
[clojure.core$seq__5402 invokeStatic "core.clj" 137]
[clojure.core$seq__5402 invoke "core.clj" 137]
[shadow.cljs.devtools.server.npm_deps$main invokeStatic "npm_deps.clj" 241]
[shadow.cljs.devtools.server.npm_deps$main invoke "npm_deps.clj" 228]
[shadow.cljs.devtools.cli_actual$main invokeStatic "cli_actual.clj" 141]
[shadow.cljs.devtools.cli_actual$main doInvoke "cli_actual.clj" 132]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.core$apply invokeStatic "core.clj" 669]
[clojure.core$apply invoke "core.clj" 660]
[shadow.cljs.devtools.cli_actual$_main invokeStatic "cli_actual.clj" 219]
[shadow.cljs.devtools.cli_actual$_main doInvoke "cli_actual.clj" 217]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 665]
[clojure.core$apply invoke "core.clj" 660]
[shadow.cljs.devtools.cli$_main invokeStatic "cli.clj" 75]
[shadow.cljs.devtools.cli$_main doInvoke "cli.clj" 67]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 665]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]]}]
shadow-cljs - HTTP server available at <http://localhost:8000>
shadow-cljs - server version: 2.9.10 running at <http://localhost:9630>
shadow-cljs - nREPL server started on port 42499
shadow-cljs - watching build :app
my shadow-cljs.edn
;; shadow-cljs configuration
{:source-paths
["src"]
:dependencies
[[reagent "1.0.0"]
[cljs-ajax "0.8.1"]
[re-frame "1.1.2"]]
:builds
{:app
{:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules
{:main
{:init-fn <http://lhrb.frontend.app/init|lhrb.frontend.app/init>
:entries [<http://lhrb.frontend.app|lhrb.frontend.app>]}}
:devtools
{:http-root "public"
:http-port 8000}
:nrepl {:port 9000}}}}
👆there is the :nrepl in the wrong position
i tried some things before i ask
;; shadow-cljs configuration
{:source-paths
["src"]
:dependencies
[[reagent "1.0.0"]
[cljs-ajax "0.8.1"]
[re-frame "1.1.2"]]
:builds
{:app
{:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules
{:main
{:init-fn <http://lhrb.frontend.app/init|lhrb.frontend.app/init>
:entries [<http://lhrb.frontend.app|lhrb.frontend.app>]}}
:devtools
{:http-root "public"
:http-port 8000}}}
:nrepl {:port 9000}}
so cider will start shadow up like this:
npx shadow-cljs -d nrepl/nrepl:0.8.3 -d cider/cider-nrepl:0.25.8 server
and then in the repl after connecting:
shadow.user> (require '[shadow.cljs.devtools.api :as shadow])
nil
shadow.user> (shadow/watch :app)
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (174 files, 0 compiled, 0 warnings, 3.87s)
:watching
shadow.user> (js/alert "hi")
Syntax error compiling at (*cider-repl clojure/asg-ignite-app:localhost:58111(clj)*:17:14).
No such namespace: js
shadow.user> (shadow/nrepl-select :app)
To quit, type: :cljs/quit
[:selected :app]
cljs.user> (js/alert "hi")
nil
cljs.user>
i try this npx shadow-cljs -d nrepl/nrepl:0.8.3 -d cider/cider-nrepl:0.25.8 server
Okay now cider ask me to select a clojure repl type
shadow
or shadow-select
?
i did cider-connect
(not the cljs one). but try shadow-select and then choose your build
You can mute this warning by changing cljr-suppress-middleware-warnings.shadow.user>
shadow.user> (require '[shadow.cljs.devtools.api :as shadow])
;; => nil
shadow.user> (shadow/watch :app)
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (216 files, 215 compiled, 0 warnings, 38.84s)
;; => :watching
shadow.user> (js/alert "hi")
Syntax error compiling at (*cider-repl workspace/listshare:localhost:9000(clj)*:26:14).
No such namespace: js
But I guess I have to change the namespace again?
no you have to enter the cljs repl
shadow.user> (shadow/nrepl-select :app)
To quit, type: :cljs/quit
[:selected :app]
cljs.user> (js/alert "hi")
nil
so you're telling shadow to watch :app (compile the cljs files and recompile if they change) and then select that repl (nrepl-select :app)
yes that worked
and I also can evaluate now
Thanks a lot!!!
glad you got it working!
and my pleasure
Awesome. Took me a lot of time to finally come here and ask. You are a great person just helping randoms on the internet 🙏
always pop in to ask questions. I had forgotten how this stuff worked and it was helpful to go through it with you. And i was similarly confused earlier today trying to get <https://github.com/logseq/logseq>
up locally so you helped me simplify it and hopefully i can get it going toniight
Glad I could also help I guess