clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.55k stars 645 forks source link

Broken keyword results in middleware error #3010

Closed arichiardi closed 3 years ago

arichiardi commented 3 years ago

Hi there, I have just bumped to v1.1.0.1 and I keep getting errors when hovering over keys that do not exist/are broken.

It happens every time so I guess it's related to new functionality with keywords?

  Show: Project-Only All 
  Hide: Clojure Java REPL Tooling Duplicates  (79 frames hidden)

  This is an unexpected CIDER middleware error.
  Please submit a bug report via `M-x cider-report-bug`.

  If these stacktraces are occurring frequently, consider using the
  button(s) below to suppress these types of errors for the duration of
  your current CIDER session. The stacktrace buffer will still be
  generated, but it will "pop under" your current buffer instead of
  "popping over". The button toggles this behavior.

 Suppress macroexpand-error 

1. Unhandled java.lang.RuntimeException
   Invalid token: ::q::

                 Util.java:  221  clojure.lang.Util/runtimeException
           LispReader.java:  412  clojure.lang.LispReader/interpretToken
           LispReader.java:  305  clojure.lang.LispReader/read
           LispReader.java:  216  clojure.lang.LispReader/read
           LispReader.java:  205  clojure.lang.LispReader/read
                   RT.java: 1878  clojure.lang.RT/readString
                   RT.java: 1873  clojure.lang.RT/readString
                  core.clj: 3815  clojure.core/read-string
                  core.clj: 3805  clojure.core/read-string
           macroexpand.clj:  118  cider.nrepl.middleware.macroexpand/expand-clj/fn
           macroexpand.clj:  117  cider.nrepl.middleware.macroexpand/expand-clj
           macroexpand.clj:  111  cider.nrepl.middleware.macroexpand/expand-clj
           macroexpand.clj:  216  cider.nrepl.middleware.macroexpand/macroexpansion
           macroexpand.clj:  212  cider.nrepl.middleware.macroexpand/macroexpansion
           macroexpand.clj:  222  cider.nrepl.middleware.macroexpand/macroexpansion-reply
           macroexpand.clj:  221  cider.nrepl.middleware.macroexpand/macroexpansion-reply
        error_handling.clj:  160  cider.nrepl.middleware.util.error-handling/eval95851/fn
              MultiFn.java:  234  clojure.lang.MultiFn/invoke
           macroexpand.clj:  225  cider.nrepl.middleware.macroexpand/handle-macroexpand
           macroexpand.clj:  224  cider.nrepl.middleware.macroexpand/handle-macroexpand
                  Var.java:  388  clojure.lang.Var/invoke
                 nrepl.clj:  283  cider.nrepl/wrap-macroexpand/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
        dynamic_loader.clj:   97  nrepl.middleware.dynamic-loader/wrap-dynamic-loader/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  489  cider.nrepl/wrap-undef/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  507  cider.nrepl/wrap-xref/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  428  cider.nrepl/wrap-stacktrace/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  522  cider.nrepl/wrap-clojuredocs/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  117  cider.nrepl/wrap-slurp/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  133  cider.nrepl/wrap-classpath/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  460  cider.nrepl/wrap-trace/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                lookup.clj:   51  nrepl.middleware.lookup/wrap-lookup/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  125  cider.nrepl/wrap-apropos/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  204  cider.nrepl/wrap-info/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  438  cider.nrepl/wrap-test/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  497  cider.nrepl/wrap-version/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  339  cider.nrepl/wrap-profile/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
    interruptible_eval.clj:  154  nrepl.middleware.interruptible-eval/interruptible-eval/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  159  cider.nrepl/wrap-debug/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  186  cider.nrepl/wrap-enlighten/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
            sideloader.clj:  104  nrepl.middleware.sideloader/wrap-sideloader/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
               session.clj:  363  nrepl.middleware.session/add-stdin/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  223  cider.nrepl/wrap-inspect/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  330  cider.nrepl/wrap-out/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
             load_file.clj:   81  nrepl.middleware.load-file/wrap-load-file/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                caught.clj:   97  nrepl.middleware.caught/wrap-caught/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  105  cider.nrepl/wrap-content-type/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  296  cider.nrepl/wrap-ns/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  402  cider.nrepl/wrap-resource/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  376  cider.nrepl/wrap-refresh/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 nrepl.clj:  478  cider.nrepl/wrap-tracker/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
               session.clj:  309  nrepl.middleware.session/session/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                 print.clj:  234  nrepl.middleware.print/wrap-print/fn
            middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
                server.clj:  130  nrepl.server/default-handler/fn
                server.clj:   22  nrepl.server/handle*
                server.clj:   19  nrepl.server/handle*
                server.clj:   39  nrepl.server/handle/fn
                  core.clj: 2030  clojure.core/binding-conveyor-fn/fn
                  AFn.java:   18  clojure.lang.AFn/call
           FutureTask.java:  266  java.util.concurrent.FutureTask/run
   ThreadPoolExecutor.java: 1149  java.util.concurrent.ThreadPoolExecutor/runWorker
   ThreadPoolExecutor.java:  624  java.util.concurrent.ThreadPoolExecutor$Worker/run
               Thread.java:  748  java.lang.Thread/run
bbatsov commented 3 years ago

There are no related changes I can think of. And I see something triggered macroexpansion for you, so I'm not sure what triggered this for you. Perhaps we changed something on the client side that I forgot about already. :D

arichiardi commented 3 years ago

Oh ok, well I should't have mentioned that cause it might be unrelated. I will try to repro in a smaller code base.

bbatsov commented 3 years ago

It'd be nice if you figured out what triggers macroexpand on the client side.

yuhan0 commented 3 years ago

It's probably this line here from #2826: https://github.com/clojure-emacs/cider/blob/061a6db1e641fb338976b137c1175574e102c22e/cider-util.el#L134

I had the fix on my local copy of Cider since last September but didn't get around to a PR, sorry!