Fork me on GitHub
#cider
<
2019-01-31
>
Karol Wójcik08:01:08

Ok I will subscribe to the issue. thank you @dominicm @dpsutton

manuel08:01:17

hey guys. Is there any chance C-c M-n (`cider-repl-set-ns`) in a REPL buffer can limit the namespaces to the project namespaces?

jumar13:01:37

Hmm, I (almost) always set the repl ns to the current buffer's ns... I'm not sure what you're trying to achieve.

manuel13:01:25

Say I'm in the REPL, and I want to switch to another buffer, which is not the one I am visiting in the other buffer currently showing beside the REPL.

manuel13:01:53

Ideally, I want to switch to a project-based namespace, not to some external one.

manuel13:01:00

I achieved what I want with:

(defun mu-cider-repl-set-ns (ns)
    "Switch the namespace of the REPL buffer to NS.
If called from a cljc buffer act on both the Clojure and ClojureScript REPL
if there are more than one REPL present.  If invoked in a REPL buffer the
command will prompt for the name of the namespace to switch to."
    (interactive (list (if (or (derived-mode-p 'cider-repl-mode)
                               (null (cider-ns-form)))
                           (completing-read "Switch to namespace: "
                                            (projectile-current-project-files))
                         (cider-current-ns))))
    (when (or (not ns) (equal ns ""))
      (user-error "No namespace selected"))
    (cider-map-repls :auto
      (lambda (connection)
        (cider-nrepl-request:eval (format "(in-ns '%s)" ns)
                                  (cider-repl-switch-ns-handler connection)))))
Which differs from the original because it relies on (projectile-current-project-files). Problem solved. 🙂

manuel13:01:06

Sort of, the REPL looks like this now:

src/cinvat/adapters/arca/core.clj> 
Still needs some work.

jumar09:02:43

Ah, I didn't even know that it's possible to use cider-repl-set-ns from the repl buffer

manuel08:01:12

this would help, for instance, when looking for core and not ending up with many candidates from other libraries.

Patrick Winter15:01:25

Hi, I'm trying to get CIDER to work with nREPL.

Patrick Winter15:01:07

I've added nREPL as dependency to my profiles.clj.

~/.lein cat profiles.clj 
{:repl {:dependencies [[nrepl/nrepl "0.5.0"]]}}

Patrick Winter15:01:43

However cider-jack-in still launches the old version.

dpsutton15:01:06

you need to be on lein version 2.8.3. I suspect you are on 2.8.1 or older?

dpsutton15:01:37

also, CIDER will inject that for you so you don't need it

dpsutton15:01:45

lein upgrade 2.8.3 should solve your woes

Patrick Winter15:01:15

@dpsutton Thanks! I'm on NixOS so leiningen was installed through nix.

dpsutton15:01:44

do you know how to upgrade it then?

Patrick Winter15:01:08

I guess I need to create an override. I will ask a few people in the NixOS IRC channel.

dpsutton15:01:51

i don't know how to help you there so i can just wish you good luck!

Patrick Winter15:01:18

thanks for your help!

myguidingstar19:01:57

@patrickwinter 2.8.3 is available on nixos already

myguidingstar19:01:06

I'm a nixos user, too

myguidingstar19:01:47

but you need to install it from unstable channel(s)

myguidingstar19:01:42

nix-env -iA nus.leiningen

exit219:01:52

hi all, anyone have any ideas what this might mean? Unhandled REPL handler exception processing message {:op clone, :id 1}

dpsutton19:01:39

how did you trigger this? you are starting a new repl session and dying at the start. got information about the project type, cider version, etc?

exit219:01:20

yeah its a new cider session, then it fails out with this message

exit219:01:26

this is a fulcro application

exit219:01:01

let me see if I can find version.. one moment

dpsutton19:01:16

also, how do you expect this to start up? lein, clj, boot?

exit219:01:06

0.19.0-SNAPSHOT

dpsutton19:01:12

what's your lein version?

exit219:01:55

actually I think this is the beginning of the error:

exit219:01:06

[WARNING] No nREPL middleware descriptor in metadata of #'refactor-nrepl.middleware/wrap-refactor, see nrepl.middleware/set-descriptor!
ERROR: Unhandled REPL handler exception processing message {:id 9d733e0f-2b56-43d3-ae83-82c0626e9879, :op describe}

dpsutton19:01:20

what's your lein version?

exit219:01:27

Leiningen 2.8.3 on Java 1.8.0_181 Java HotSpot(TM) 64-Bit Server VM

dpsutton19:01:48

try lein upgrade 2.8.1.

dpsutton19:01:41

2.8.3 requires nrepl 0.5.x and 2.8.1 worked with older tools.nrepl. I'm thinking you can upgrade your CIDER or downgrade your lein. I think you are straddling the changeover

exit219:01:31

ok let me try that