scip-java v0.8 with Bazel support and "Find implementations"
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
withscip-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 runningscip-java index
now produces anindex.scip
file instead ofdump.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 commandyarn global add @sourcegraph/src
. The latest version ofsrc
is needed to recognise the newindex.scip
file, which is generated byscip-java index
. Runningsrc precise-intel upload
(previously,src lsif upload
) accepts bothindex.scip
anddump.lsif
files. If you’re not uploading to Sourcegraph, runscip convert --from=index.scip --to=dump.lsif
to convert any SCIP payload into LSIF. Thescip
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
- Add LICENSE (#451) @jdorfman
- Rename LSIF into SCIP (#449) @olafurpg
- Fix brittle code related to launching a Bazel process (#448) @olafurpg
- Bump pr-auditor go version to 1.18 (#447) @sanderginn
- Add Bazel support, fixes #88 (#439) @olafurpg
- Fix a few bugs on Windows (#436) @olafurpg
- Clarify what files are needed for Gradle and Maven builds (#438) @olafurpg
- copy JDK_HOME bootstrap files to forwarding toolchain directory for Kotlin (#418) @Strum355