Skip to content

Extract semanticdb utilities to a shared module#899

Merged
jupblb merged 5 commits into
mainfrom
michal/semadb-collapse
Jun 3, 2026
Merged

Extract semanticdb utilities to a shared module#899
jupblb merged 5 commits into
mainfrom
michal/semadb-collapse

Conversation

@jupblb
Copy link
Copy Markdown
Member

@jupblb jupblb commented Jun 3, 2026

No description provided.

jupblb added 5 commits June 3, 2026 14:06
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 jupblb marked this pull request as ready for review June 3, 2026 15:24
@jupblb jupblb merged commit 68ae888 into main Jun 3, 2026
12 checks passed
@jupblb jupblb deleted the michal/semadb-collapse branch June 3, 2026 15:30
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant