Fork me on GitHub
#cider
<
2021-02-07
>
solf09:02:14

@lukas.block For long strings, nothing cider can do about it. You can check some emacs built-in modes though: toggle-truncate-lines and visual-line-mode. For app-db, I'm not really sure what's the issue, a screenshot would be good. In general, if the object doesn't pprint nicely, I use cider-inspect (binded to C-c M-i by default)

Lukas10:02:32

Thank you a lot. I didn't know about cider inspect this is a really helpful enhancement of my work flow 😊

RollACaster14:02:34

Hi 👋 I started a shadow-cljs project with: shadow-cljs watch frontend --config-merge '{:closure-defines {vizards.nobil.core/APIKEY "123"}}' which works fine but when I try to run cider-connect-cljs, cider tries to run

(do (require '[shadow.cljs.devtools.api :as shadow]) (shadow/watch :frontend) (shadow/watch :--config-merge) (shadow/watch :'{:closure-defines {vizards.nobil.core/NOBILKEY "123"}}') (shadow/nrepl-select :frontend))
Is this a bug or do I need to call cider differently?

dpsutton14:02:29

I’m assuming you have a dir locals file that sets some values. There’s probably a cljs repl type and a startup form in there

RollACaster14:02:23

Yes thanks, I deleted my dir locals file and now I get a different error so at least there’s some progress 🙂 I initially tried to configure --config-merge via dir locals but failed to do so, do you know how to configure that properly?

frozenlock14:02:01

Is there a way to make cider display a reagent component arguments? [my-comp arg1 arg2] (eldoc)

dpsutton14:02:44

Why did you delete that file. It sounded like it had some goodies in it. But it looks like it’s calling watch twice which is no good

dpsutton14:02:35

Looks like you just need to tweak the custom cljs command

RollACaster15:02:49

I tried soo many different configurations to make this work in the last hour that deleting the file felt really good 😄 I tried to overwrite the custom cljs command with

((clojurescript-mode . ((cider-shadow-cljs-command . "npx shadow-cljs --config-merge '{:closure-defines {vizards.nobil.core/APIKEY \"123\"}}'"))))
now shadow-cljs starts but closure-defines is not set

dpsutton15:02:04

ah yeah that's no good

dpsutton15:02:36

(setq cider-shadow-cljs-parameters "--config-merge '...'") should do it for you

dpsutton15:02:30

you've set the executable to use with cider-shadow-cljs-command.

dpsutton15:02:38

i've got an issue open to kinda clean all this stuff up

dpsutton15:02:47

or document it so this is far easier.

dpsutton15:02:37

but in general there are knobs for the-actual-executable some-options middleware stuff cider-does-stuff-here final-options-passed-in and you just want some final trailing options so that's what you want

RollACaster15:02:14

But cider-shadow-cljs-parameters is set to server if I replace it with parameters no supported shadow-cljs action is found

dpsutton15:02:09

you custom set it to server?

RollACaster15:02:11

(I also tried (setq cider-shadow-cljs-parameters "server --config-merge '{:closure-defines {vizards.nobil.core/APIKEY \"123\"}}'") but this is ignored as well)

dpsutton15:02:38

(just a heads up your api key may be public above)

👍 3
dpsutton15:02:12

ok. give me one second to go see how shadow expects this. in the meantime some dir locals like the following should work

((nil . ((cider-default-cljs-repl . custom)
         (cider-custom-cljs-repl-init-form .
                                           "(do (require '[shadow.cljs.devtools.api :as shadow])
                                               (shadow/watch :your-app {:config :here})
                                               (shadow/nrepl-select :your-app))"))))

dpsutton15:02:38

ok. i'm guessing you can't pass a config merge in to server as config is per build, not global?

dpsutton15:02:48

possibly the easiest thing to do: 1. in a terminal run the exact watch command you want with the config-merge. ensure that cider/nrepl is on the command line -d cider/cider-nrepl "0.25.8". There should be an example at the top of repls of the jack-in command. 2. cider-connect-cljs and choose shadow-select and the watched build

RollACaster08:02:59

I finally made it work with shadow-select thanks! (I did not work work with the custom REPL since my REPL tried to evaluate my closure-defines variable which does only exist in the cljs REPL but not in the clj REPL. I tried to quote it but this resulted in closure-defines being ignored. But at least it works with shadow-select 🙂 )

RollACaster15:02:13

No I am still not able to make it work 🙈 Unfortunatly I have to leave now. But I am sure it will work by following your instructions when I stop programming in anger and rechecking all my local setup 😁 Thanks so much for your help I will retry it tomorrow

parens 3
jobo320822:02:09

hi all, i'm using cider-nrepl via vim-fireplace for cljs development. i'm having some trouble with commands that use the info op. basically when i have the following ns:

(ns my-ns.spec
  (:require
    [clojure.spec.alpha :as s :refer-macros [coll-of]]))
and i do an info op for coll-of, it works as expected:
send: {"ns": "my-ns.spec", "symbol": "coll-of", "op": "info", ...}
receive: {"status": ["done"], "doc": "Returns a spec..."}
however, when i don't refer coll-of directly, the info op fails for s/coll-of:
(ns my-ns.spec
  (:require
    [clojure.spec.alpha :as s :include-macros true]))

send: {"ns": "my-ns.spec", "symbol": "s/coll-of", "op": "info", ...}
receive: {"status": ["done", "no-info"], ...}
the problem only seems to happen for macros; it works fine for e.g. s/explain. i'm also able to eval code with s/coll-of with no problem. it just seems to be a problem with the info op. am i doing something wrong?