Fork me on GitHub
#cider
<
2017-07-14
>
benedek09:07:23

when I jack-in-clojurescript there are two REPLs created. is there a way to exit them both with one command?

featheredtoast16:07:06

@benedek http://cider.readthedocs.io/en/latest/managing_connections/ - C-u C-c C-q seems to be what you're looking for

benedek16:07:02

yes and no @featheredtoast

benedek16:07:18

this cloases all connections

benedek16:07:49

if I happen to be jacked in on multiple projects this would close all of them

benedek16:07:36

would be nice just to close clj and cljs buffers for the same project with one go

featheredtoast16:07:36

fair enough, that seems to be the only way sofar that I know of, assuming you're on a single project

benedek16:07:26

fair, thanks

rickmoynihan17:07:04

does anyone know why with cider, how sometimes setting and evaluating a #dbg form doesn’t work? I don’t get an error, just the breakpoint is never hit. Not even when I refresh.

rickmoynihan17:07:14

sometimes it works, others it doesn’t and I never know why

rickmoynihan17:07:26

I’m on 0.14.0 of cider

grzm20:07:38

@rickmoynihan have you tried 0.15.0-SNAPSHOT? I don't know if there's a resolution, but at least you'll know whether you can confirm the behavior with the latest CIDER.

rickmoynihan20:07:26

@grzm: Hey thanks for the reply… I tried it yesterday (not to resolve this issue - just to try it) and it seemed a little buggy with my setup, so I switched back to 0.14.0

rickmoynihan20:07:38

jump to definition seemed a little glitchy… I’d have to do it twice for some reason IIRC before it’d jump.

grzm20:07:56

Yuck. Sorry to hear it.

rickmoynihan20:07:22

not sure if it was a cider issue or just my emacs - but didn’t have time to debug

rickmoynihan20:07:25

i think the debugger behaved similarly (i.e. worked sometimes not others)

rickmoynihan20:07:31

but can’t be sure

grzm20:07:46

I find debugging CIDER very frustrating 😕 I'm currently fighting CIDER/cider-nrepl right now. I'm starting my nrepl server from the command line to pick up environment variables, and I'm getting version mismatches which is preventing me from running cider-refresh. And something I did last night fixed it, and then something I did today broke it again.

rickmoynihan20:07:59

I ran into that same issue

grzm20:07:30

Did you resolve it?

rickmoynihan20:07:59

yeah I managed to formulate a work around

rickmoynihan20:07:23

I created a script called lein-cider and use lein-cider repl to start my repl. The script then injects the cider middleware in the same way M-x cider-jack-in does:

#!/bin/bash

lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.3.1\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.14.0\"\] -- "[email protected]"

grzm20:07:26

Yeah, that looks similar to what I was doing last night, though I'm using boot.

rickmoynihan20:07:51

problem for me was that a dependency was somehow a higher precedence than my :user profile. I’ve only seen it on one project we have.

benedek20:07:57

generally speaking it is not a good idea to have something in your lein/boot profiles.clj and also inject deps from the CLI

benedek20:07:11

@grzm i think you can define env variables in emacs itself

benedek20:07:27

for that reason you don’t really need to start from CLI

benedek20:07:16

in fact i guess you can set them in lein/boot too

benedek20:07:45

or using some config support library there are loads 🙂 but surely i am not aware of your full context…

rickmoynihan20:07:53

@grzm: You can? I tried a few things but never got it to work quite right on mac. Problem I had is that GUI emacs starts up outside of the shell (via the UI) so skips the env vars.

grzm20:07:13

@benedek I'm using emacsformacosx, which doesn't pick up bash profiles, etc.

benedek20:07:17

try setenv?

benedek20:07:27

i am using that too

benedek20:07:33

love the ligature support

rickmoynihan20:07:00

@benedek: that might well work… but i’d have to maintain the env vars in two places

grzm20:07:13

Yeah, the point using the environment variables is to not have to maintain them in two places.

rickmoynihan20:07:18

basically I use wrapenv to manage my env vars for different projects etc… I’d found it’s easier to do it outside of emacs https://github.com/RickMoynihan/wrapenv

dotemacs20:07:45

@rickmoynihan are you using exec-path-from-shell ? https://github.com/purcell/exec-path-from-shell

rickmoynihan20:07:06

@dotemacs: I had tried that a while back, but like I said I like to swap the environments

dotemacs20:07:19

ah, my bad, sorry

grzm20:07:23

@dotemacs Would that work for a GUI emacs? Any custom path set by a profile would ignore those customizations.

rickmoynihan20:07:46

though if I recall it never seemed to work quite right for me… probably did something wrong

dotemacs20:07:32

@grzm the whole point of that package is to make sure that your Mac installed Emacs picks up your env vars from your shell init file, instead of the “default” ones

benedek20:07:36

i am really thinking hard here…. but as far as i remember at least in jvm clojure if you use the java api to get env variables and run my project in a repl they are picked up…

grzm20:07:50

@dotemacs gotcha. I see that now from reading it.

benedek20:07:58

but perhaps i am tricked by my memory. would not be the first time…

benedek20:07:05

ok so i might be right then @dotemacs 😉

rickmoynihan20:07:49

oh just remembered the other thing that seemed broken in 0.15.0-SNAPSHOT jumping to source from a stackframe

grzm20:07:20

okay. I should be able to use cider-connect to connect to an nrepl server started with boot repl -s wait

grzm20:07:46

From a boot repl (no -s wait option), I can see (:version-string cider.nrepl.version/version) ;; => "0.15.0-snapshot", which is what I expect because I have that version of cider-nrepl in my dependencies.

grzm20:07:17

When I use cider-connect, I see this warning: WARNING: CIDER's version (0.15.0-snapshot) does not match cider-nrepl's version (nil). Things will break!

grzm20:07:57

Any suggestions for my next step of debugging?

rickmoynihan20:07:59

i don’t know much about boot; but if it were lein, I’d be running either lein deps :tree or lein classpath right now

grzm20:07:00

That makes sense. The equivalent of lein deps is boot show -p

benedek20:07:03

since you are connecting you need to make sure the middlewares are there yourself

benedek20:07:31

so you basically need to add them via boot.profile or something similar

benedek20:07:47

see the cider documentation

grzm20:07:45

@benedek the cider task? I have that defined as per https://github.com/boot-clj/boot/wiki/Cider-REPL

grzm20:07:32

(with updated versions) That's been working when I use cider-jack-in

benedek20:07:21

hold on. so you have that defined but you don’t use it when you start up the repl you connect to from cider?

benedek20:07:35

so the documentation you linked says you have to start up your repl like

grzm20:07:47

@benedek thanks. That's what I've been forgetting today. sigh

benedek20:07:13

cider repl -s wait

grzm20:07:14

It's working now

grzm20:07:43

@benedek ++

benedek20:07:45

:rubber: 🦆 😉

grzm20:07:03

Without tools like the repl, would developing in JVM Clojure even be practical?

benedek21:07:35

not sure i follow…

grzm21:07:00

I just know that when I'm not able to use CIDER, my development cycle slows to a crawl. The dev/compile/test cycle is so long.

grzm21:07:32

ClojureScript I suspect wouldn't be so bad, using bootstrapped ClojureScript.

benedek21:07:03

haha well, ok. the REPL is awesome yes. shorter the feedback loop better is the dev experience for sure

benedek21:07:28

you can get many diff repls for clojurescript and there is figwheel as well

benedek21:07:40

which makes cljs experience even better

grzm21:07:02

It's been about a year since I did much ClojureScript development.

benedek21:07:20

have you used figwheel?

grzm21:07:36

I was at the time, yes. That was pretty sweet.

grzm21:07:34

I like the way Bruce Hauman thinks.