Fork me on GitHub
#cider
<
2021-02-04
>
bmaddy03:02:05

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.

bmaddy03:02:05

If this isn't a cider thing, let me know and I'll ask over in #emacs.

dpsutton03:02:36

Not aware of anything in cider that would do that

👍 3
thanks3 3
bozhidar07:02:58

Might be some advice to reformat on pasting.

bozhidar07:02:12

It's certainly not coming from CIDER, though.

oly11:02:11

is there a way to jump to core library code in cider or library code ?

oly11:02:45

so if my cursor is on db/query I want to peak the fn to see what its doing

tvirolai11:02:20

Sure, cider-find-var does that.

oly12:02:56

ah cheers exactly what i want, who would have thought find var to find a function 😛

borkdude12:02:16

Bound to M-. usually

oly12:02:27

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 🙂

craftybones12:02:57

Hello. I’m facing a problem similar to the one in this ticket: https://github.com/clojure-emacs/cider/issues/2237

craftybones12:02:36

However, I’m on

;; CIDER 0.25.0snapshot (package: 20200602.710), nREPL 0.7.0
;; Clojure 1.10.1, Java 14.0.2

craftybones12:02:43

I’m using Spacemacs

craftybones13:02:57

I evaluate anything that throws an exception and the dialog shows up 1 second later, maybe more

craftybones13:02:11

I’ve accidentally ended up exiting emacs a few times as a consequence 🙂

craftybones13:02:32

Does anybody have a suggestion other than upgrading packages? That is a last resort…

craftybones13:02:16

Ah, alright, Ignore, I gave up and upgraded, the Cider version certainly seemed old. Seems to have fixed it

Lukas20:02:35

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?

dpsutton20:02:52

what happens when you hit C-c C-e?

Lukas20:02:49

nothing it just hangs

Lukas21:02:01

I use doom emacs if this helps

Lukas21:02:37

just to add I'm a emacs noob 😇

dpsutton21:02:38

is this a webapp? If so, evaluate (js/alert "HI") to prove you're actually in a cljs repl

Lukas21:02:19

this works after i switch the namespace (shadow.cljs.devtools.api/repl :app)

Lukas21:02:39

but C-c C-e still does nothing

dpsutton21:02:20

how did you connect? cider-connect-cljs and then chose shadow-select?

Lukas21:02:28

cider-connect-cljs and then select host +port

dpsutton21:02:04

and how did you start shadow?

Lukas21:02:33

shadow-cljs watch app

dpsutton21:02:05

and do you have cider-nrepl in your deps?

Lukas21:02:13

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 
shadow-cljs - server version: 2.9.10 running at 
shadow-cljs - nREPL server started on port 42499
shadow-cljs - watching build :app

Lukas21:02:38

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 
     :entries []}}

   :devtools
   {:http-root "public"
    :http-port 8000}
   :nrepl {:port 9000}}}}

Lukas21:02:28

👆there is the :nrepl in the wrong position

Lukas21:02:37

i tried some things before i ask

Lukas21:02:41

;; 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 
     :entries []}}

   :devtools
   {:http-root "public"
    :http-port 8000}}}

 :nrepl {:port 9000}}

dpsutton21:02:18

also, is this a :deps true type project?

Lukas21:02:59

no but i have a deps project in the same folder

dpsutton21:02:35

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> 

Lukas21:02:24

i try this npx shadow-cljs -d nrepl/nrepl:0.8.3 -d cider/cider-nrepl:0.25.8 server

Lukas21:02:33

Okay now cider ask me to select a clojure repl type

Lukas21:02:53

shadow or shadow-select?

dpsutton21:02:05

i did cider-connect (not the cljs one). but try shadow-select and then choose your build

Lukas21:02:41

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

Lukas21:02:10

But I guess I have to change the namespace again?

dpsutton21:02:19

no you have to enter the cljs repl

dpsutton21:02:22

shadow.user> (shadow/nrepl-select :app)
To quit, type: :cljs/quit
[:selected :app]
cljs.user> (js/alert "hi")
nil

dpsutton21:02:48

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)

Lukas21:02:39

yes that worked

Lukas21:02:48

and I also can evaluate now

Lukas21:02:06

Thanks a lot!!!

dpsutton21:02:13

glad you got it working!

dpsutton21:02:16

and my pleasure

Lukas21:02:15

Awesome. Took me a lot of time to finally come here and ask. You are a great person just helping randoms on the internet 🙏

dpsutton21:02:30

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 up locally so you helped me simplify it and hopefully i can get it going toniight

Lukas21:02:26

Glad I could also help I guess

cider 3