cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
solf 2021-02-07T09:15:14.195200Z

@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)

Lukas 2021-02-07T10:48:32.198Z

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

RollACaster 2021-02-07T14:30:34.199400Z

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?

dpsutton 2021-02-07T14:34:29.201Z

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

RollACaster 2021-02-07T14:41:23.203Z

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?

2021-02-07T14:51:01.203700Z

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

dpsutton 2021-02-07T14:55:44.204900Z

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

dpsutton 2021-02-07T14:56:35.205800Z

Looks like you just need to tweak the custom cljs command

RollACaster 2021-02-07T15:02:49.209Z

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

dpsutton 2021-02-07T15:03:04.209200Z

ah yeah that's no good

dpsutton 2021-02-07T15:03:36.210300Z

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

dpsutton 2021-02-07T15:04:30.210900Z

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

dpsutton 2021-02-07T15:04:38.211200Z

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

dpsutton 2021-02-07T15:04:47.211500Z

or document it so this is far easier.

dpsutton 2021-02-07T15:05:37.212600Z

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

RollACaster 2021-02-07T15:07:14.214Z

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

dpsutton 2021-02-07T15:09:09.214500Z

you custom set it to server?

RollACaster 2021-02-07T15:10:20.215300Z

No server is the default (https://docs.cider.mx/cider/1.0/cljs/shadow-cljs.html)

RollACaster 2021-02-07T15:11:11.215900Z

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

dpsutton 2021-02-07T15:11:38.216200Z

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

๐Ÿ‘ 1
dpsutton 2021-02-07T15:13:12.217Z

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))"))))

dpsutton 2021-02-07T15:16:38.217500Z

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

dpsutton 2021-02-07T15:18:48.219600Z

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

RollACaster 2021-02-09T08:03:59.229700Z

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 ๐Ÿ™‚ )

RollACaster 2021-02-07T15:27:13.220600Z

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

1
jobo3208 2021-02-07T22:59:09.223100Z

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?