clojure-emacs/ac-nrepl

java.lang.ClassNotFoundException thrown

wrn opened this issue · 5 comments

wrn commented

When enter something like "clojure.repl/", java.lang.ClassNotFoundException exception will be thrown. Here is a patch to fix that:
(Sorry the formatting is all messed up. Basically, Just one line is changed on "when-let" clause)

((defun ac-nrepl-candidates-static-methods ()
  "Return static method candidates."
  (ac-nrepl-candidates*
   (ac-nrepl-filtered-clj
    "(let [prefix \"%s\"]
       (if-not (.contains prefix \"/\")
         '()
          (let [scope (symbol (first (.split prefix \"/\")))]
            (map (fn [memb] (str scope \"/\" memb))
                 (when-let [class (try (complete.core/resolve-class scope) (catch java.lang.ClassNotFoundException e nil))]
                   (complete.core/static-members class))))))  ")))

Hey @samaaron, have you seen this error?

Weird, I don't get an error when entering clojure.repl/. I wonder what's different. I guess it causes no harm to wrap this up in a try catch - but really it would be good to figure out why complete.core throws an exception here.

@wrn out of interest, which versions of Emacs, Clojure, and the JVM are you using?

Maybe it's due to different complete.core versions -- which version do you have, @wrn?

I've gone ahead and committed the fix, but if @wrn could provide feedback about the software versions, that would be appreciated.