Is there a way to have autoimport of Java classes in spacemacs (when programming clj)? E.g., if I type Robot.
, I'd like to have some way to spacemacs autodetect that it's a Java class: java.awt.Robot
, so I don't have to lookup myself the namespace/package of that Java class.
@kurt.sys Sorry, I dont understand. If i use (import java.util.Date)
in a namespace definition and evaluate that expression, then I get autocompletion on java classes. I can use (Date.)
and get the docstring in the mini buffer. I dont need to write java.util.Date
in the code.
I assume that when you evaluate the import expression, the Java class names would be available as part of autocomplete. This has worked for the Java classes I have used, although I have not used very many.
The only additional thing I did was add the Java sources using a .dir-locals.el
file, so maybe I have only used Java classes within that library.
https://practicalli.github.io/spacemacs/navigating-code/java-definitions.html
@jr0cket that's not exactly what I mean: I mean, when I type Date.
in the code, I'd like spacemacs to autoimport java.util.Date
, without me adding it manually. In many cases, I do know the Java class, but I don't know the package name. Having autoimport on the classes is what I'm looking for.
sorry, no idea. Not something I would use.
ok... I tend to use it all the time (since I usually don't know the package name, only the class name, if I'm using Java classes, and it adds some overhead to lookup the package name)
As its #cider specific, perhaps that channel has more ideas
It might be something that clj-refactor
does, although I havent used that in a long while
I've started using org-journal to keep a diary of project work (giving me a nice sense of if I am accomplishing anything). I've added a page on using org-journal and how to add it to the org layer with layer variables https://practicalli.github.io/spacemacs/org-mode/org-journal.html
(It is not me…)