Fork me on GitHub
#cider
<
2022-07-08
>
Toni Tuominen12:07:26

is there a way to set indent style for a whole namespace? similar to (put-clojure-indent 'my-ns/do 1) but with a wildcard?

vemv13:07:13

sounds an odd thing to want. A ns can have all sorts of macros (and it's subject to future changes), each with a different indent style.

Toni Tuominen13:07:14

https://github.com/fulcrologic/semantic-ui-wrapper there's a ton of ui-* components and I'd like to set a style for all of them in one go instead of having to list each one individually

vemv13:07:41

can you post an example var from that repo?

Toni Tuominen13:07:19

I would use it like this ` (sui/ui-table-row {} (sui/ui-table-cell {:singleLine true} name) (sui/ui-table-cell {} net-multiplier) (sui/ui-table-cell {:singleLine true} (sui/ui-button {:color "blue"} "Muokkaa") (sui/ui-button {:color "red"} "Poista"))))`

Toni Tuominen13:07:25

since it makes highly nested structures it's not that nice that it formats them like function args

vemv13:07:56

ok, please post the namespace in question, I need to see their code

vemv13:07:22

thanks! I think the use case is pretty exceptional. Have you considered creating a PR adding :style/indent 0metadata to all those vars? You could complete it with a deftest asserting that all vars in that ns have that metadata, that way it will be future-proof

vemv13:07:25

You could even do it programatically in one go, e.g. (doseq [v (ns-publics (the-ns 'fulcro-blah))]) CIDER will pick it up Best of all, you can try it locally before creating a PR (and you can refrain from a PR at all)

Toni Tuominen13:07:38

I'll give it a go thanks

borkdude16:07:27

When I am not in a cider-connect buffer, but I want to eval something against the most recently used JVM Clojure, can I do this in elisp, and how?

borkdude16:07:00

The use case, I'm in a .cljs buffer which is not connected to a REPL, but the JVM Clojure project does use the .cljs file so I want to send a command to that REPL to process it

borkdude16:07:58

or evaluate something in a buffer, that's not currently focused, would also be good

borkdude16:07:12

like (cider-eval-in-buffer "foo.clj" "(+ 1 2 3)")

apt18:07:40

I don’t know the answer, but just if it’s useful for anyone: inf-clojure works like that by default [1]. I do that a lot for developing libs and testing them on the fly on its clients. But then, of course, by using inf-clojure you loose all nrepl and cider goodies. [1]: https://github.com/clojure-emacs/inf-clojure/

fenton18:07:55

My goal is to have both clj&cljs repls working in a single project. Currently I run shadow in a terminal so would like to connect to it. What is the right workflow to achieve this? Do I cider-jack-in-clj and cider-connect-cljs. Should these be in the same session. My understanding is that sessions group client nREPLs to use the same nREPL server. But don't I have two nREPL servers, on for shadow (cljs) and one for the backend clojure?

codeasone20:07:03

@fenton here's how I've set things up for full stack work in the past in case it provides some pointers https://github.com/codeasone/starter-cider-tools-deps-shadow - been using the approach for over a year now with no workflow issues under cider, taping out to the shadow cljs inspector from both clj and cljs contexts in particular is great.

Toni Tuominen08:07:50

Link doesn't work

codeasone08:07:01

Ah, sorry about that. Should be available now.

Toni Tuominen10:07:55

Yeah works now thanks

fenton17:07:34

@U191H9E5C how do I buy you a beer? Thanks for clearing the path buddy, very much appreciated!

codeasone17:07:25

Ha ha, and I thought I was a bit mad for going off-piste originally, glad you've found something that works for you.

codeasone09:07:32

@fenton another (more mainstream?) approach to getting your REPLs in order with respect to clj(cs) files and sesman https://gist.github.com/codeasone/6b2edf963915621ee66f938364875cd6. I'm considering switching to this for my work project, as it seems behaves well.