Extract semanticdb utilities to a shared module#899
Merged
Conversation
Move the proto-free symbol-encoding helper to a new semanticdb-shared module so semanticdb-java and semanticdb-kotlinc can both depend on it. The Kotlin Symbol value class and SemanticdbSymbolDescriptor data class now delegate descriptor encoding to the shared Java implementation instead of duplicating it.
Collapse the Java and Kotlin proto definitions into a single canonical schema at semanticdb-shared/src/main/protobuf/semanticdb.proto, generated to com.sourcegraph.semanticdb. The Java schema (a strict superset of the Kotlin one) wins. The standalone semanticdb-java SBT/Bazel module is removed; semanticdb-javac, scip-semanticdb, and semanticdb-kotlinc now all depend on semanticdb-shared. Snapshot regeneration produces byte-identical output, confirming no behavioral change to .semanticdb files.
Extracts SemanticdbMd5, SemanticdbPaths and SemanticdbWriter into semanticdb-shared so the javac and kotlinc plugins stop duplicating the digest, output-path, URI, and single-document write logic. Side effect: semanticdb-kotlinc URIs are now joined with '/' regardless of platform, matching semanticdb-javac (and resolving the existing 'unix-style only' TODO in SemanticdbTextDocumentBuilder).
MessageDigest is stdlib, and each plugin can express its own hex conversion idiomatically (Kotlin one-liner via joinToString, small Java loop). The helper added no real value beyond hiding 3 lines.
jupblb
added a commit
that referenced
this pull request
Jun 3, 2026
Rebased onto origin/main (post #899's semanticdb-shared extraction). - semanticdb-javac: replace SemanticDB protobuf emission with SCIP shards (ScipShardWriter/Aggregator/Occurrences/Symbols/Signatures + ScipVisitor). - semanticdb-kotlinc: add the SCIP shard infrastructure alongside the existing SemanticDB code path (dropped fully in stacked PR B). - scip-semanticdb: ScipShardAggregator walks per-source shards, applies SymbolRewriter, and merges into a single Index. - Use the shared semanticdb-shared module's symbol/builder utilities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.