cider icon indicating copy to clipboard operation
cider copied to clipboard

"Find fn references" does not work

Open johbra opened this issue 5 years ago • 7 comments

Looking for fn references (using a Clojurescript real) yields the following exception:

Show: Project-Only All Hide: Clojure Java REPL Tooling Duplicates (12 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 fn-refs-error

  1. Unhandled java.lang.Exception No namespace: dep.model.modul found

               core.clj: 4162  clojure.core/the-ns
               core.clj: 4369  clojure.core/ns-resolve
               core.clj: 4359  clojure.core/ns-resolve
               core.clj: 4359  clojure.core/ns-resolve
               xref.clj:   21  cider.nrepl.middleware.xref/fn-refs-reply
               xref.clj:   20  cider.nrepl.middleware.xref/fn-refs-reply
     error_handling.clj:  160  cider.nrepl.middleware.util.error-handling/eval2174/fn
           MultiFn.java:  234  clojure.lang.MultiFn/invoke
               xref.clj:   29  cider.nrepl.middleware.xref/handle-xref
               xref.clj:   28  cider.nrepl.middleware.xref/handle-xref
               Var.java:  388  clojure.lang.Var/invoke
              nrepl.clj:  489  cider.nrepl/wrap-xref/fn
         middleware.clj:   16  nrepl.middleware/wrap-conj-descriptor/fn
             server.clj:   19  nrepl.server/handle*
             server.clj:   16  nrepl.server/handle*
             server.clj:   36  nrepl.server/handle/fn
               core.clj: 2030  clojure.core/binding-conveyor-fn/fn
               AFn.java:   18  clojure.lang.AFn/call
        FutureTask.java:  264  java.util.concurrent.FutureTask/run
    

    ThreadPoolExecutor.java: 1128 java.util.concurrent.ThreadPoolExecutor/runWorker ThreadPoolExecutor.java: 628 java.util.concurrent.ThreadPoolExecutor$Worker/run Thread.java: 834 java.lang.Thread/run

The namespace dep.model.modul does exist in file named model.cljc.

johbra avatar Oct 21 '20 11:10 johbra

That functionality is Clojure-specific, but it seems I forgot to make this explicit in the code.

bbatsov avatar Oct 21 '20 11:10 bbatsov

if I try the same using a Clojure repl I get the same error message

johbra avatar Oct 21 '20 11:10 johbra

Did you evaluate the ns in question?

bbatsov avatar Oct 21 '20 11:10 bbatsov

Perhaps I didn't.

New shot: Two of my loaded namespaces: dep.model.lehrveranstaltung dep.model.modul The function mussModulUnterrichtetWerdenFuer-inQuartal? is defined dep.model.modul and used in dep.model.lehrveranstaltung. But looking for fn references yields the answer: No references found for "mussModulUnterrichtetWerdenFuer-inQuartal?" in currently loaded namespaces. But I get no exception anymore.

Both namespaces are defined in clic-files.

johbra avatar Oct 21 '20 12:10 johbra

I'm seeing the same error after updating from I think some version of cider 25 in my ClojureScript projects. Tried both melpa stable and 20201020..1058 .

I'm not sure if it's actually the same error, the errors I can find are not very descriptive, but it does also happen on function lookup.

[nREPL] Establishing direct connection to localhost:11000 ...
[nREPL] Direct connection to localhost:11000 established
eldoc error: (error Format specifier doesn’t match argument type)
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 eldoc-error 

1. Unhandled java.lang.NullPointerException
   (No message)

bbss avatar Oct 22 '20 07:10 bbss

@bbss Your problem seems unrelated, so it'd be best to report it separately. It seems there's some unhandled NPE in the cider-nrepl eldoc middleware op.

bbatsov avatar Oct 24 '20 08:10 bbatsov

My mistake, had mismatched nrepl middleware in the projects. Thanks!

bbss avatar Oct 26 '20 12:10 bbss

We're fixing all xref-related stuff in the upcoming CIDER release.

vemv avatar Aug 05 '23 21:08 vemv