-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
(cider-javadoc) cannot fetch javadoc for basic Java class such as "java.lang.Integer" #894
Comments
Yeah, that's a bug. Someone (perhaps me) copied the var completion code in the javadoc handler. I'll have it fixed. |
@bbatsov If this is a simple fix, could you outline the fix? If it takes more in-depth fix, perhaps a brief idea where to start? Really appreciate your time & work. |
It works properly for a symbol at point, but when there isn't a symbol at point you'll be presented with a list of var names. We should change this to use |
…ut Java class name when no "symbol-at-point". The regression derives from complecting "cider-read-symbol-name" and "cider-completing-read-var": Not all symbols are vars, e.g., Java classes on JVM. The current solution is to add an optional parameter "notvarp" to "cider-read-symbol-name": When "notvarp" is nil (the default), complete var by the current "cider-completing-read-var"; otherwise (when "notvarp" is t), use "cider-read-from-minibuffer". "cider-javadoc" can call "cider-read-symbol-name" with "notvarp" being t to bypass "cider-completing-read-var". The logic is that, by its name, "cider-read-symbol-name" should work for both vars and non-var symbols (e.g., Java classes). However, most majority of current use of "cider-read-symbol-name" is for vars. So add a "notvarp" predicate (nil by default) would bridge the semantic gap between "cider-read-symbol-name" and "cider-completing-read-var" without disturbing most uses. WISHLIST: If only there could be a completion function for Java classes, perhaps derived on the nrepl side by (ns-imports *ns*), ...
…ut Java class name when no "symbol-at-point". The regression derives from complecting "cider-read-symbol-name" and "cider-completing-read-var": Not all symbols are vars, e.g., Java classes on JVM. The current solution is to add an optional parameter "notvarp" to "cider-read-symbol-name": When "notvarp" is nil (the default), complete var by the current "cider-completing-read-var"; otherwise (when "notvarp" is t), use "cider-read-from-minibuffer". "cider-javadoc" can call "cider-read-symbol-name" with "notvarp" being t to bypass "cider-completing-read-var". The logic is that, by its name, "cider-read-symbol-name" should work for both vars and non-var symbols (e.g., Java classes). However, most majority of current use of "cider-read-symbol-name" is for vars. So add a "notvarp" predicate (nil by default) would bridge the semantic gap between "cider-read-symbol-name" and "cider-completing-read-var" without disturbing most uses. WISHLIST: If only there could be a completion function for Java classes, perhaps derived on the nrepl side by (ns-imports *ns*), ...
Also, I am not familiar with cider and cider-nrepl enough to know this: Do we have "completion" function for Java classes (perhaps furnished by nrepl through If we have this, we can have something similar to "cider-completing-read-var" for Java classes, e.g., "cider-completing-read-class". |
Not sure if this is a "cider" or "cider-nrepl" issue.
With helm-mode enabled, (cider-javadoc) only sees (Helm completions for) Clojure var (e.g., conj) but not Java class (e.g., java.lang.Integer) symbols. Try to enter "Integer" or "java.lang.Integer" result in "[no match]."
Relevant code seems to be:
cider-javadoc-handler
cider-javadoc
cider-var-info
So it appears that info of symbols like Integer/java.lang.Integer are not passed along from cider-nrepl client.
CIDER 0.8.1 (package: 20141123.1045) (Java 1.7.0_71, Clojure 1.6.0, nREPL 0.2.6)
~/.lein/profiles
(cider-classpath)
The text was updated successfully, but these errors were encountered: