-
Notifications
You must be signed in to change notification settings - Fork 40
Implement LSIF emitter in Java. #127
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
Conversation
| .zipWithIndex | ||
| .foreach { case (line, i) => | ||
| out.append(line) | ||
| out.append(line.replace("\t", "→")) |
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.
Im curious if theres a reason we cant do replace("\t", " ") instead here.
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.
I we can do that but it removes the fact that there's a tab character, which may be helpful to debug an issue.
| writer.emitItem(ids.referenceResult, rangeId, doc.id); | ||
|
|
||
| // Definition | ||
| if (occ.getRole() == SymbolOccurrence.Role.DEFINITION && ids.isDefinitionDefined()) { |
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.
in what case is ids.isDefinitionDefined() == true aka when would we have two identical definitions?
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 definition ID should always be available in this case, it's a bug if it's not. I updated the code to report an error message in this case instead of silently ignoring it.
Previously, we shelled out to `lsif-semanticdb` to convert SemanticDB files into LSIF. This commit ports the original Go implemementation to Java so that we can call a normal method instead of shelling out to a separate process. The biggest problem with the previous solution is that it complicated installation for users. As we evolve lsif-java, the conversion logic will also evolve and we want to avoid the situation where users have an outdated version of lsif-semanticdb installed. With this commit, users only need to install `lsif-java` and everything should work correctly. This commit also adds a new `snapshot-lsif` command to pretty-print an LSIF index, similar to how we pretty-print SemanticDB payloads. This command is mostly useful for testing purposes, but could be helpful to troubleshoot user issues.
Previously, we shelled out to
lsif-semanticdbto convert SemanticDBfiles into LSIF. This commit ports the original Go implemementation to
Java so that we can call a normal method instead of shelling out to a
separate process.
The biggest problem with the previous solution is that it complicated
installation for users. As we evolve lsif-java, the conversion logic
will also evolve and we want to avoid the situation where users have
an outdated version of lsif-semanticdb installed. With this commit,
users only need to install
lsif-javaand everything should workcorrectly.
This PR also adds a new
snapshot-lsifcommand to pretty-print anLSIF index, similar to how we pretty-print SemanticDB payloads. This
command is mostly useful for testing purposes, but could be helpful
to troubleshoot user issues.
LSIF snapshot generated for lsif-go
LSIF snapshot generated for lsif-node