-
Notifications
You must be signed in to change notification settings - Fork 176
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
Add Java class and method resolution to info middleware. #40
Conversation
This looks awesome. Can't wait to try it out. |
Build is failing, this still doesn't solve the problem of adding the sources artifacts to the classpath. We'd need pomegranate for that, I think, and the lein plugin might have to do some magic coordination behind the scenes if this is to be made automatic. |
I think we can grab maven artifact info from manifest of the jar using some classloader hacks on the class in question, then it would be trivial to add a "sources" classifier and download things on demand with pomegranate. http://stackoverflow.com/questions/2712970/how-to-get-maven-artifact-version-at-runtime |
Hmm. The code doesn't attempt to inject the Clojure sources artifacts to the classpath -- it leaves that to lein at launch time. No trickery should be necessary. Does the CI server respect the |
Ah, if we can get the build to pass, automating sources could just be an added feature. Eclipse does it, I always found it cool :-). |
Agreed! I like when my tools to the work for me. :-) To use Pomegranate to grab source artifacts automagically, there are a few wrinkles though:
FWIW, the |
Clean up Java source file resolution. Use ASM EmptyVisitor stubs for ClassVisitor/MethodVisitor. Move line number distinctness check from class fn to method fn. Also, add method return type to method info. Use classpath to resolve JDK sources. Update info middleware and add tests for Java info. Add Java method info test for info middleware. Use explicit ASM dependency instead of Clojure's. Clojure 1.6 bundles ASM 4.0, which has breaking API changes from the 3.x releases bundled with previous versions of Clojure. To support both multiple Clojure releases, we'll specify our dependency ASM version explicitly. Resolve top-level .java file for nested classes. Use snapshot builds for sources jar (workaround for CLJ-1161). Update travis test script to use dev profile.
@@ -1,4 +1,5 @@ | |||
language: clojure | |||
script: lein2 with-profile dev test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests all pass. The :dev
dependencies just weren't being added to the classpath for the Travis CI build.
👍 |
Add Java class and method resolution to info middleware.
I assumed it was derived from the `docs_dir`, it seems it's set by default to `edit/master/docs/`. More details - https://www.mkdocs.org/user-guide/configuration/#edit_uri
This gives Java classes/methods "info" middleware support. Like Clojure functions, the Java method's name, parent class, arglists (for overloads), source file, and line number are returned.
The accompanying PR for CIDER is 537.