Fork me on GitHub
#cider
<
2019-02-18
>
alexyakushev16:02:01

I assume something has changed in CIDER recently regarding the initial namespace the REPL starts with? It is now user for me instead of boot.user. Any chance to customize this?

cichli16:02:30

See cider-repl-init-code

cichli16:02:49

You could add "(in-ns 'boot.user)"

cichli16:02:23

I’m not sure why the behaviour has changed, though. Possibly related to the changes to how bindings are handled in nREPL

chase-lambert16:02:32

looks like there is: Customizing the initial REPL namespace Normally, the CIDER REPL will start in the user namespace. You can supply an initial namespace for REPL sessions in the repl-options section of your Leiningen project configuration: :repl-options {:init-ns 'my-ns}

bhauman16:02:06

How is cider detecting the root of a project? It currently doesn’t recognize projects that only have a deps.edn file at the root for me.

bhauman16:02:19

I think I have to update a helper library

alexyakushev16:02:07

@chase-lambert Thanks. I think I found this before but looks like it's Leiningen only

chase-lambert16:02:03

That's true. I haven't ventured too much outside of leiningen yet. I'm already getting used to hitting C-c M-n M-n to just set it as soon as the repl is running. C-u C-c C-z puts you in the repl with the ns too.

dpsutton16:02:12

@bhauman it should "speak" deps.edn. check out cider--identify-buildtools-present

bhauman16:02:44

thanks @dpsutton I’ll check it out 🙂

chase-lambert16:02:45

I do miss it being defaulted to the project ns though

dpsutton16:02:15

although actually clojure-project-root-path might be the better place to look

dpsutton16:02:38

also @bhauman would love comments here (https://github.com/clojure-emacs/cider/pull/2586) about editing jack in command with a prefix

dpsutton16:02:14

(make it trivial to add aliases and profiles)

bhauman16:02:43

@dpsutton I like the proposed behavior, so you are saying you want cider to present the shell command in its entirely every time before launching?

dpsutton16:02:01

not every time. there's a defcustom to make that happen or just send a prefix with jack in command

dpsutton16:02:12

but yeah, it presents the entire shell command so its easy to know where and what you can edit

bhauman16:02:24

yeah with prefix emacs arg makes a lot of sense

mikepjb16:02:27

Does anyone know how to set jvm-opts from cider-lein-parameters? Extra information: To pass jvm-opts to lein you declare it with the :jvm-opts key, I'd like to make this portable so I can inject the key in the same way nrepl/cider-nrepl are passed in via cider jack-in e.g /usr/local/bin/lein update-in :dependencies conj \[nrepl\ \"0.5.3\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.20.0\"\] I think the answer will be something similar to this (set-variable 'cider-lein-parameters "update-in :jvm-opts conj \\[\\\"-Xmx5g\\\"\\] --") But somewhere I'm going wrong because lein prints out the available tasks instead of starting a REPL.

dpsutton16:02:27

should make following tutorials or doing what coworkers are doing trivial

cichli16:02:43

@mikepjb lein also supports the JVM_OPTS environment variable

cichli16:02:15

Possibly you want "update-in :jvm-opts conj \\\"-Xmx5g\\\" --" though? i.e. just conj the string rather than a vec containing the string

mikepjb16:02:40

thanks @cichli guessing the first solution might look like (setenv "JVM_OPTS" "-Xmx5g") in my emacs config?

mikepjb16:02:48

I'll try the update-in first and let you know if that works

cichli16:02:19

Yeah or set cider-lein-command to JVM_OPTS="-Xmx5g" lein

cichli16:02:37

(FWIW I generally try and set these kinds of things in lein profiles rather than in editor config, if you really want to use -Xmx5g everywhere you could add it to your :user profile)

dpsutton16:02:35

the proposed patch that i linked above will make this trivial. you have full access to the command to be invoked so presumably you can just add this prefix

mikepjb17:02:41

@cichli this works (set-variable 'cider-lein-parameters "update-in :jvm-opts conj \"\\\"-Xmx5g\\\"\" -- repl :headless :host localhost")

borkdude20:02:06

What’s the story with newest CIDER and using the newest 2.8.2 boot version? Are their nREPL versions compatible?

cichli21:02:46

Sorry, I missed this message! You should include [nrepl "0.6.0"] – I think boot still bundles 0.4.something