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
Make Java bindings more IDE-friendly #13540
Comments
After performing some unknown steps, it started working in Java files in both VS Code and IntelliJ, but not for the same imports in Scala files in the same project, despite sources jars being present. I investigated a bit more and noticed the directory structure inside, e.g., the |
Interestingly bindings-scala_2.13-2.0.0-sources.jar is "ok". I haven't found much on what the "RFCs" say about the allowability of the extra top-level directories, but in practice IDE Java plugins have "learned" to handle this, while Metals and other Scala plugins seemingly have not. |
Since it's open source I investigated a bit more. :) It turns out the Scala jars are "good" because the However I cannot fully understand why we are hitting this. For the rxjava bindings, the reason is |
A bit more experimentation, but no real insight. The exact paths getting passed to build the sources jar relate to both the location of the |
Update: A fix was done in Metals upstream for the issue I reported relating to this: scalameta/metals#3815 however I'm still seeing the problem. |
Update another fix to scalameta/metals#3815 has resolved this for Metals. It would still be nice to clean up the unneeded hierarchy produced in the Bazel build, but the real world impact is less now. |
What is the problem you want to solve?
VS Code and IntelliJ both have trouble finding the sources and javadoc for the Java Bindings automatically or even with prodding. This can be seen in the quickstart-java template for example where hovering over the
com.google
orio.reactivex
imports at the top ofIouMain.java
will pull up JavaDoc and control-clicking will go to source code, but not so for thecom.daml
ones.What is the solution you would propose?
I believe this has something to do with how the artifacts are published to Maven Central. If you check the pom for Google's Guava, for example, you'll find XML relating to sources and javadoc, which is absent in the rxjava and java bindings ones.
I don't really know if this is required, however additional points like "TBD" in the artifact descriptions and empty source jars for others make me wonder if the publishing is fully according to the book.
Describe alternatives you've considered
Manually browsing Javadoc in a browser while working in the source is possible of course but not as efficient an experience as having these accessible through the IDE.
Additional context
Occurs for both Java and Scala projects. However with
com.daml..ledger.api.v1
gRPC stubs the source IS found.The text was updated successfully, but these errors were encountered: