Fork me on GitHub
#cider
<
2018-11-19
>
Paco00:11:29

how do I make a deps.edn project also load my test deps?

bozhidar08:11:29

> does anyone know whether compliment is responsible for returning keyword info like spec location? I am trying to understand how to solve cider issue #2523

manuel11:11:36

in a project with deps.edn and shadow-cljs, is it possible to make cider-jack-in-clj default to clojure-cli instead of prompting for a choice?

manuel11:11:00

now it's asking me to choose between clojure-cli and shadow-cljs.

bozhidar11:11:53

Yeah, it’s possible. Check cider-preferred-build-tool.

manuel11:11:35

fantastic, thanks! Set it in .dir-locals.el, and it works as expected. I kept looking for cider default ... and cider repl ... within C-h v and missed that one. 🙂

bozhidar12:11:46

Yeah, perhaps the name isn’t ideal, but you know - naming is hard!

😄 4
manuel13:11:00

similarly, is there a way to set a default namespace for the CLJ REPL to be automatically in when cider-jack-in-clj ends? I tried using cider-clojure-cli-global-options set to -m <my-ns>, but the REPL didn't show up.

manuel13:11:38

ideally I'd like to end up in my-app.core namespace

manuel14:11:34

this works via CLI, but not in cider-clojure-cli-global-options:

$ clj -e "(ns my-app.core)" -r

manuel14:11:20

For cider-clojure-cli-global-options, I tried in .dir-locals.el:

(nil
  (cider-clojure-cli-global-options . "-e \"(ns my-app.core)\" -r")
  (cider-ns-refresh-after-fn . "mount.core/start")
  (cider-ns-refresh-before-fn . "mount.core/stop")
  (cider-preferred-build-tool . clojure-cli))
)

bozhidar17:11:27

@manuel This doesn’t work as you’re not evaluating this code via nREPL. 🙂

bozhidar17:11:15

I don’t recall if we have something about this currently, but in general it’s not hard to implement.

dpsutton17:11:01

this is the job of user.clj(s) isn't it? does user.cljs work like user.clj?

bozhidar17:11:56

@dpsutton Good idea! In lein I always used :init-ns, but I guess just adding some (in-ns ...) to user.clj is a more generic approach to tackle this.

bozhidar17:11:41

I was also thinking that we can add :init-ns to the new .nrepl.edn config file.

bozhidar17:11:06

I just don’t know if people would prefer this namespace to be required automatically be default or not.

dpsutton17:11:39

which ns? i thought clojure used user.clj[s] by default when it is found on the classpath

manuel20:11:40

thanks for the explanation, it makes sense now.

michal23:11:18

hey, is there any way to enforce clj repl type for cljs sources? I mean, I don't use any cljs-specific repl in my project, I simply would like to switch to connected clj repl instead of getting a No cljs REPLs in current session "clojure/xxxx:localhost:5600" message.

dpsutton23:11:01

you could try m-x clojure-mode

michal23:11:57

@dpsutton yeah, the problem is, I would have to do it for each cljs file which I want to switch to repl from.

dpsutton23:11:14

i think you will need to override some functions in CIDER

dpsutton23:11:25

you are fighting against the grain here obviously, and this might really muck things up for you in other projects where you do want to send cljs stuff to cljs repls but check out cider-repl-type-for-buffer and perhaps have that always return "clj". perhaps you can add some more logic into it that checks if it is in "that" project, etc

michal23:11:31

seems like I chose a hard way 🙂 anyway, thanks for hints.

dpsutton23:11:25

is it just not feasible to use clojurescript?