-
Notifications
You must be signed in to change notification settings - Fork 29
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
Enable cross-repo navigation. #166
Conversation
d01703e
to
e5920f3
Compare
Previously, lsif-java was only able to index a single repositories. It was not possible to navigate between repositories. Now, the emitted LSIF contains `packageInformation` nodes that document how to link LSIF indexes between repositories. Rough summary of the changes in this commit: - New `LsifBuildTool` that we use to index `*-sources.jar` of Java libraries and the JDK sources. - New `ClasspathEntry` class to represent a Maven library. We extract `ClasspathEntry` values from the build via text files in the SemanticDB targetroot. - Miscellaneous small bugfixes while indexing the JDK and Guava. - Fixes sourcegraph#150. - Improved error reporting to debug issues in the `javac` wrapper that we use for Gradle and Maven.
| def artifactType = org.gradle.api.attributes.Attribute.of("artifactType", String.class) | ||
| def attributeType = "jar" | ||
| if (config.canBeResolved) { | ||
| def artifacts = config.incoming.artifactView { view -> | ||
| view.lenient = true | ||
| view.attributes { container -> | ||
| container.attribute(artifactType, attributeType) | ||
| } | ||
| }.artifacts |
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.
Really interesting! How did you come across this solution?
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.
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.
Damn, wish I knew of this many months ago 😆
@@ -74,6 +74,7 @@ public SemanticdbVisitor( | |||
|
|||
private <T extends JCTree & JCDiagnostic.DiagnosticPosition> void emitSymbolOccurrence( | |||
Symbol sym, T posTree, Role role, CompilerRange kind) { | |||
if (sym == null) return; |
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.
Is this an issue you came across?
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.
Yeah, hit on three NPEs when compiling the JDK
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.
🎉 awesome work! A lot to unpack here but LGTM 🙂
Previously, lsif-java was only able to index a single repositories. It
was not possible to navigate between repositories. Now, the emitted LSIF
contains
packageInformation
nodes that document how to link LSIFindexes between repositories.
Rough summary of the changes in this commit:
LsifBuildTool
that we use to index*-sources.jar
ofJava libraries and the JDK sources.
ClasspathEntry
class to represent a Maven library. We extractClasspathEntry
values from the build via text files in theSemanticDB targetroot.
javac
wrapper thatwe use for Gradle and Maven.