Fork me on GitHub
#cider
<
2016-05-25
>
jgertm11:05:45

eldoc isn't displaying any information anymore since a couple of days. i'm running spacemacs from develop branch with up-to-date packages. any ideas why this could be?

cskksc15:05:34

eldoc has been through some changes recently. do you get any error message in the *Messages* buffer ?

bbss15:05:54

Hmm after doing cider-jack-in-clojurescript the repl of both clj and cljs start and connect, I can evaluate in them, and I can C-c C-c in a clj file but the clojurescript buffer I started the jack-in says:

user-error: `cider-eval-defun-at-point' needs a ClojureScript REPL.
If you don't know what that means, you probably need to jack-in (`C-c M-J').

bbss15:05:53

Didn't change the project but did recently add clj-refactor and ac-cider.

bbss15:05:25

Any idea how to proceed? I am pretty new to emacs (using spacemacs).

malabarba15:05:47

@bbss: Are you sure the Cljs repl is not just a clojure-repl?

bbss15:05:21

Yes I am sure, it's printing to the browser console

malabarba15:05:21

For instace, if you evaluate inc. Do you see a java class or a javascript function?

malabarba15:05:53

On that repl, do M-: cider-repl-type. What do you get?

malabarba15:05:10

Yeah, that's the problem.

malabarba15:05:22

Did you get any warnings when you connected?

malabarba15:05:31

Sounds like you don't have the middleware

bbss15:05:32

I did not see any warnings, in the repl at least. Let me check messages

bbss15:05:16

Starting nREPL server via /Users/baruchberger/bin/lein update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.12\"\] -- update-in :plugins conj \[refactor-nrepl\ \"2.3.0-SNAPSHOT\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.13.0-SNAPSHOT\"\] -- repl :headless...
nREPL server started on 55866
[nREPL] Establishing direct connection to localhost:55866 ...
[nREPL] Direct connection established
Connected.  May the Source be with you!
[nREPL] Establishing direct connection to localhost:55866 ...
[nREPL] Direct connection established
Connected.  Learn the rules like a pro, so you can break them like an artist. -Pablo Picasso
Starting a custom ClojureScript REPL

bbss15:05:22

Looks fine to me.

malabarba15:05:35

What's your ClojureScript repl?

bbss15:05:51

figwheel

malabarba15:05:09

COuld you file an issue with reproduction instructions?

malabarba15:05:37

Sounds like this is a tricky one

malabarba15:05:47

It really should be working

malabarba15:05:59

I can get you a workaroudn in the meantime

bbss15:05:24

Hmm okay, I am so afraid it will be one of those "local to my machine" kind of things.

malabarba15:05:10

With cljs, there's a good chance it's a real bug

malabarba15:05:26

the spectrum of cljs repls is just absurd

bbss15:05:05

Yeah, hard to find my way 😄

bbss15:05:01

I must add that I have a kind-of exotic set-up. I am connecting to a chrome-extension, which required me to tunnel 443 to 3449 (figwheel) and set-up figwheel to use secure websockets.

bbss15:05:17

Actually let me check if it's not somehow related to nginx, didn't try that yet.

malabarba15:05:56

I got dizzy just by reading that. 🙃

bbss15:05:59

Hahah.. Yeah.. But it did work before for some time!

stephenmhopper15:05:42

I have a quick question (and let me know if I’m way off base or doing something horribly wrong), but I’m starting up a remote nrepl server for my app and connecting to it from cursive’s built in remote REPL functionality. Is there a way to force everything that’s sent to and from that session to print to the console out on the server? I’m using an uberjar at the moment and my startup code looks like this:

(ns my-ns.core
  (:require [clojure.tools.nrepl.server :as nrepl]
            [cider.nrepl :as cider])
  (:gen-class))

(defonce server (atom nil))

(defn shutdown [] (nrepl/stop-server (deref server)))

(defn -main
  [& args]
  (reset! server (nrepl/start-server :port 1234 :bind "localhost" :handler cider/cider-nrepl-handler))
  (println "Hello, World!"))

malabarba16:05:01

@stephenmhopper: You could write a middleware for that. But I'm not sure how you would add it to nrepl

malabarba16:05:08

There's certainly a way, though

stephenmhopper16:05:20

But this isn’t some pre-existing functionality?

bbss16:05:28

@malabarba: you mentioned a work-around?

malabarba16:05:25

@bbss what's you emacs version?

bbss16:05:40

@malabarba: GNU Emacs 24.5.1 (x86_64-apple-darwin14.5.0, NS apple-appkit-1348.17) of 2016-04-27 on Baruchs-MBP

bbss16:05:03

With spacemacs, don't know if that could be related

malabarba16:05:15

(defun hack-connection-type (cs)
  (mapcar (lambda (c)
            (with-current-buffer c
              (when (string-match "CLJS" (buffer-name))
                (setq cider-repl-type "cljs"))))
          cs)
  cs)

(advice-add 'cider-connections :filter-return #'hack-connection-type)

bbss16:05:47

I put that in the spacemacs config init function?

bbss16:05:57

It worked!

bbss16:05:01

You voodoo master!

bbss16:05:06

@malabarba: Thanks a bunch 🙂 Really amazing how quickly you helped me. I am not sure what to include in a bug report.

bbss16:05:27

Might try to re-install emacs, spacemacs and the redo the configuration first either way.

malabarba16:05:16

Yeah. I was going to suggest at least reinstalling CIDER first, just in case.

adamfrey18:05:37

has anyone else reported a error with Cider and company-mode completions? I get this error consistently when typing clojure function names: Error running timer company-echo-show: (error "Company: backend (company-capf company-dabbrev-code) error \"Wrong type argument: sequencep, 115\" with args (meta reductions)” I just wanted to check before trying to find a minimal repro case.