LSIF indexers
Language support is an ever-evolving feature of Sourcegraph. Some languages may be better supported than others due to demand or developer bandwidth/expertise. This page clarifies the status of the LSIF indexers which the Sourcegraph team can both recommend to customers and provide support for.
For a more complete description of the LSIF indexer ecosystem, see LSIF.dev. A Sourcegraph instance can ingest any LSIF index file confirming to the LSIF specification. The absence of a third-party indexer on this page is not a quality judgment on that indexer; it is that Sourcegraph engineers may not have the required knowledge to provide deep technical support.
Quick reference
This table is maintained as an authoritative resource for users, Sales, and Customer Engineers. Any major changes to the development of our indexers will be reflected here.
Language | Indexer | Status | Hover docs | Go to definition | Find references | Cross-file | Cross-repository | Find implementations | Build tooling |
---|---|---|---|---|---|---|---|---|---|
Go | lsif-go | 🟢 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - |
TypeScript/JavaScript | lsif-node | 🟡 | ✓ | ✓ | ✓ | ✓ | ✓ | ✗ | - |
C/C++ | lsif-clang | 🟡 | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ | See notes |
Java | lsif-java | 🟢 | ✓ | ✓ | ✓ | ✓ | ✓* | ✗ | See notes |
Scala | lsif-java | 🟢 | ✓ | ✓ | ✓ | ✓ | ✓* | ✗ | See notes |
Kotlin | lsif-java | 🟢 | ✓ | ✓ | ✓ | ✓ | ✓* | ✗ | See notes |
Rust | rust-analyzer | 🟢 | ✓ | ✓ | ✓ | ✓ | ✗ | ✗ | See notes |
*Requires enabling and setting up Sourcegraph's auto-indexing feature. Further information in Auto-indexing.
Status definitions
An indexer status is:
- 🟢 Generally Available: Available as a normal product feature, no major features are absent.
- 🟡 Partially available: Available, but may be limited in some significant ways. No major features are absent but edge cases remain.
- 🟠 Beta: Available in pre-release form on a limited basis. Could be useful to early adopters despite lack of features.
- 🟣 Experimental: Available in pre-release form, with significant caveats. Early adopters can try it with expectations of failure.
Milestone definitions
A common set of steps required to build feature-complete LSIF indexers is broadly outlined below. The implementation order and doneness criteria of these steps may differ between language and development ecosystems. Major divergences will be detailed in the notes below.
Cross repository: Emits monikers for cross-repository support
The next milestone provides support for cross-repository definitions and references.
The indexer can emit a validated LSIF index file including import monikers for each symbol defined non-locally, and export monikers for each symbol importable by another repository. This index should be consumed without error by the latest Sourcegraph instance and Go to Definition and Find References should work on cross-repository symbols given that both repositories are indexed at the exact commit imported.
At this point, the indexer may be generally considered ready. Some languages and ecosystems may require some of the additional following milestones to be considered ready due to a bad out-of-the-box developer experience or absence of a critical language features. For example, lsif-java is nearly useless without built-in support for build systems such as gradle, and some customers may reject lsif-clang if it has no support for a language feature introduced in C++ 14.
Common build tool integration
The next milestone integrates the indexer with a common build tool or framework for the language and surrounding ecosystem. The priority and applicability of this milestone will vary wildly by languages. For example, lsif-go uses the standard library and the language has a built-in dependency manager; all of our customers use Gradle, making lsif-java effectively unusable without native Gradle support.
The indexer integrates natively with common mainstream build tools. We should aim to cover at least the majority of build tools used by existing enterprise customers.
The implementation of this milestone will also vary wildly by language. It could be that the indexer runs as a step in a larger tool, or the indexer contains build-specific logic in order to determine the set of source code that needs to be analyzed.
The long tail: Find implementations
The next milestone represents the never-finished long tail of feature additions. The remaining 20% of the language should be supported via incremental updates and releases over time. Support of Find implementations should be prioritized by popularity and demand.
We may lack the language expertise or bandwidth to implement certain features on indexers. We will consider investing resources to add additional features when the demand for support is sufficiently high and the implementation is sufficiently difficult.