Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M-x cider-debug-defun-at-point fails, 'No reader function for tag dbg' #1218

Closed
fromheten opened this issue Jul 19, 2015 · 16 comments
Closed

Comments

@fromheten
Copy link
Contributor

Symptoms

Running cider-debug-defun-at-point always throws a ReaderException.

I've tried this only on my machine, but in many different projects. I didn't have it in the version of Cider when cider-debug was introduced, but all subsequent versions of Cider.

How I reproduce it

Write a function like this (defn say-hi [name] (str "Hi " name " !")). Place the point somewhere, like at the space after [name] and before (str .... Hit M-x cider-debug-defun-at-point. Then it throws the exception.

What I have tried (and how I have failed)

  • Reinstalled emacs, and used a fresh ~/.emacs.d
  • Update cider
  • Tried in different projects

System

GNU Emacs 24.4.1, installed with homebrew
Mac osx 10.10.3 (Yosemite)
; CIDER 0.10.0snapshot (package: 20150717.654) (Java 1.7.0_51, Clojure 1.7.0, nREPL 0.2.7)

Stack trace

2. Unhandled clojure.lang.LispReader$ReaderException
   java.lang.RuntimeException: No reader function for tag dbg

               LispReader.java:  292  clojure.lang.LispReader/read
               LispReader.java:  196  clojure.lang.LispReader/read
               LispReader.java:  190  clojure.lang.LispReader/read
                      core.clj: 3640  clojure.core/read
                      core.clj: 3638  clojure.core/read
        interruptible_eval.clj:   68  clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn/fn
                      main.clj:  238  clojure.main/repl/read-eval-print/fn
                      main.clj:  238  clojure.main/repl/read-eval-print
                      main.clj:  258  clojure.main/repl/fn
                      main.clj:  258  clojure.main/repl
                   RestFn.java: 1523  clojure.lang.RestFn/invoke
        interruptible_eval.clj:   58  clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
                      AFn.java:  152  clojure.lang.AFn/applyToHelper
                      AFn.java:  144  clojure.lang.AFn/applyTo
                      core.clj:  630  clojure.core/apply
                      core.clj: 1868  clojure.core/with-bindings*
                   RestFn.java:  425  clojure.lang.RestFn/invoke
        interruptible_eval.clj:   56  clojure.tools.nrepl.middleware.interruptible-eval/evaluate
        interruptible_eval.clj:  188  clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
        interruptible_eval.clj:  157  clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
                      AFn.java:   22  clojure.lang.AFn/run
       ThreadPoolExecutor.java: 1145  java.util.concurrent.ThreadPoolExecutor/runWorker
       ThreadPoolExecutor.java:  615  java.util.concurrent.ThreadPoolExecutor$Worker/run
                   Thread.java:  744  java.lang.Thread/run

1. Caused by java.lang.RuntimeException
   No reader function for tag dbg

               LispReader.java: 1245  clojure.lang.LispReader$CtorReader/readTagged
               LispReader.java: 1228  clojure.lang.LispReader$CtorReader/invoke
               LispReader.java:  684  clojure.lang.LispReader$DispatchReader/invoke
               LispReader.java:  263  clojure.lang.LispReader/read
               LispReader.java:  196  clojure.lang.LispReader/read
               LispReader.java:  190  clojure.lang.LispReader/read
                      core.clj: 3640  clojure.core/read
                      core.clj: 3638  clojure.core/read
        interruptible_eval.clj:   68  clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn/fn
                      main.clj:  238  clojure.main/repl/read-eval-print/fn
                      main.clj:  238  clojure.main/repl/read-eval-print
                      main.clj:  258  clojure.main/repl/fn
                      main.clj:  258  clojure.main/repl
                   RestFn.java: 1523  clojure.lang.RestFn/invoke
        interruptible_eval.clj:   58  clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
                      AFn.java:  152  clojure.lang.AFn/applyToHelper
                      AFn.java:  144  clojure.lang.AFn/applyTo
                      core.clj:  630  clojure.core/apply
                      core.clj: 1868  clojure.core/with-bindings*
                   RestFn.java:  425  clojure.lang.RestFn/invoke
        interruptible_eval.clj:   56  clojure.tools.nrepl.middleware.interruptible-eval/evaluate
        interruptible_eval.clj:  188  clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
        interruptible_eval.clj:  157  clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
                      AFn.java:   22  clojure.lang.AFn/run
       ThreadPoolExecutor.java: 1145  java.util.concurrent.ThreadPoolExecutor/runWorker
       ThreadPoolExecutor.java:  615  java.util.concurrent.ThreadPoolExecutor$Worker/run
                   Thread.java:  744  java.lang.Thread/run
@bbatsov
Copy link
Member

bbatsov commented Jul 19, 2015

//cc @Malabarba

@Malabarba
Copy link
Member

Wow, thanks for the thorough bug report.
I'm looking into this now. Meanwhile, I noticed you said your Emacs version is 10.10.3, but that's your OS version, right? What do you get with M-x emacs-version?

@Malabarba
Copy link
Member

Also, what do you get if you evaluate *data-readers* on the REPL buffer?

@fromheten
Copy link
Contributor Author

@Malabarba Thanks :). You're absolutely right about the emacs version. I'm on 24.4.1. Updated the text to fix my error.

test.core> *data-readers*
{} ;;this is what is returned

@fromheten
Copy link
Contributor Author

By the way, on an unrelated note: Shouldn't the name of the function be 'cider-debug-defn-at-point', rather than defun?

@Malabarba
Copy link
Member

By the way, on an unrelated note: Shouldn't the name of the function be 'cider-debug-defn-at-point', rather than defun?

It should probably be def at point, or, even better, “top-level sexp at point”. But then the name starts to get a little long. :)

I used defun to be consistent with CIDER's other functions, like cider-eval-defun-at-point. In turn, I think CIDER uses “defun” to be consistent with Emacs terminology. Emacs uses defun to specify function definitions in general (even in other languages like C).

@Malabarba
Copy link
Member

Could you try bumping your tools.nrepl to 0.2.10?
We definitely support 0.2.7, but I just want to know if that's the issue.

@fromheten
Copy link
Contributor Author

It works! That fixed it.

  • Changed version in ~/.lein/profiles.clj to 0.2.10.
  • Also bumped my cider-nrepl plugin from 0.9.0-SNAPSHOT to 0.10.0-SNAPSHOT
;; current state as of 19 July 2015
{:user {
        :plugins [
                  [cider/cider-nrepl "0.10.0-SNAPSHOT"]]
        :dependencies [[org.clojure/tools.nrepl "0.2.10"]]}}

Is there some nifty way to always keep these up to date?

@Malabarba
Copy link
Member

Is there some nifty way to always keep these up to date?

I don't think so. =/

If you were using 0.9.0, then that was surely the problem. Glad it was easy to find. :)

@fromheten
Copy link
Contributor Author

Sorry for reporting a non-bug then! Thanks a lot for creating cider and cider-debug - both are invaluable and make my life better :). Appreciate it a lot!

@bbatsov
Copy link
Member

bbatsov commented Jul 19, 2015

@Malabarba So, guess we should bump the required nREPL to 0.2.10? :-)

@Malabarba
Copy link
Member

@bbatsov No. The issue was that the cider-nrepl version was 0.9.0. It's not an issue with tools.nrepl

@bbatsov
Copy link
Member

bbatsov commented Jul 19, 2015

Ah, yes. I missed this.

On Sunday, July 19, 2015, Artur Malabarba [email protected] wrote:

@bbatsov https://github.com/bbatsov No. The issue was that his
cider-nrepl was 0.9.0. It's not an issue with tools.nrepl


Reply to this email directly or view it on GitHub
#1218 (comment)
.

Best Regards,
Bozhidar Batsov

http://www.batsov.com

@Naomarik
Copy link
Contributor

I'm getting the exact error with boot described as OP with same stack trace.
This is what's in my profile.boot

(swap! boot.repl/*default-dependencies*
       concat '[[cider/cider-nrepl "0.10.0"]
                [org.clojure/tools.nrepl "0.2.12"]
                [refactor-nrepl "2.0.0-SNAPSHOT"]])

When jacking in a lein project the debugger works perfectly, so this seems to be a boot config problem.

; CIDER 0.10.0 (package: 20151204.303) (Java 1.8.0_60, Clojure 1.7.0, nREPL 0.2.12)

@Naomarik
Copy link
Contributor

Bonus output:

boot.user> cider.nrepl.middleware.debug/debug-reader
#function[cider.nrepl.middleware.debug/debug-reader]
boot.user> *data-readers*
{}

@Malabarba
Copy link
Member

@Naomarik I've created a separate issue for that, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants