Skip to content

scip-java v0.8 with Bazel support and "Find implementations"

Compare
Choose a tag to compare
@github-actions github-actions released this 08 Jun 15:20
· 254 commits to refs/heads/main since this release
75204f2

We are excited to announce the release of scip-java v0.8. The highlights of this release include:

  • New name: the project was previously called "lsif-java" and it has now been renamed into "scip-java" to reflect that it now emits a code indexing format called SCIP by default.
  • Find implementations: it’s now possible to navigate from interfaces and abstract methods to the implementations to their concrete implementations.
  • Bazel support: it’s now possible to use scip-java with Bazel builds.

New name: scip-java

We recently released SCIP, a new protocol that we are using at Sourcegraph to power precise code navigation. Previously, our Java indexer was called lsif-java because it emitted LSIF (Language Server Index Format) by default. We have renamed the indexer into scip-java to reflect that it now emits SCIP by default.

How to upgrade from lsif-java

Migrating from lsif-java to scip-java requires the following steps:

  • Replace all usages of lsif-java with scip-java. The scip-java command-line interface supports the same sub-commands and flags as the old lsif-java interface. The only functional difference is that running scip-java index now produces an index.scip file instead of dump.lsif.
  • Make sure you are using the latest version of the src command-line tool, which you can now optionally install via npm using the command yarn global add @sourcegraph/src. The latest version of src is needed to recognise the new index.scip file, which is generated by scip-java index. Running src precise-intel upload (previously, src lsif upload) accepts both index.scip and dump.lsif files. If you’re not uploading to Sourcegraph, run scip convert --from=index.scip --to=dump.lsif to convert any SCIP payload into LSIF. The scip command-line tool can be installed from here.

Find implementations

Previously, scip-java only supported "Go to definition" and "Find references". This release adds support to "Find implementations" such that you can navigate from an interface or abstract method to their concrete implementation. For example, consider the following type hierarchy

interface Animal {
  String sound();
}
class Dog implements Animal {
  @Override 
  String sound() { return "Woof!"; }
}

The "Find implementations" action navigates from the Animal interface and Animal.sound() method, to the Dog class and Dog.sound() method, respectively.

Bazel support

Previously, scip-java did not have great support for Bazel. It was possible to use scip-java with Bazel but the steps were undocumented and it required awkward workarounds. This release adds proper support for Bazel that is compatible with Bazel's build cache and allows incremental indexing.

It requires custom configuration to WORKSPACE and BUILD files to integrate scip-java with Bazel builds. It's simply not possible for scip-java index command to automatically configure everything like it does for Gradle and Maven while remaining compatible with Bazel's build model.

Check out the documentation on how to get started with configuring Bazel and scip-java.

Pull Requests