Drop SemanticDB output from semanticdb-kotlinc and remove SemanticDB pipeline (split 2/2)#897
Open
jupblb wants to merge 10 commits into
Open
Drop SemanticDB output from semanticdb-kotlinc and remove SemanticDB pipeline (split 2/2)#897jupblb wants to merge 10 commits into
jupblb wants to merge 10 commits into
Conversation
Drop the legacy SemanticDB code path from the Kotlin compiler plug-in: * ScipRole: new local enum mirroring the DEFINITION/REFERENCE subset of Semanticdb.SymbolOccurrence.Role. * SemanticdbVisitor: drop the documentBuilder field and build()/Semanticdb.TextDocument helper; the visitor now only feeds ScipTextDocumentBuilder and uses ScipRole at every emit site. * ScipTextDocumentBuilder: switch role parameter from Semanticdb.SymbolOccurrence.Role to ScipRole. * PostAnalysisExtension: remove the SemanticDB write path and the (Semanticdb.TextDocument) -> Unit callback; the extension now only walks the visitors and writes META-INF/scip/<rel>.scip shards. * AnalyzerRegistrar: remove the SemanticDB callback parameter. Delete the legacy implementation source: * SemanticdbTextDocumentBuilder.kt Delete the legacy Kotlin test suites that asserted on Semanticdb protobuf output: * src/test/kotlin/.../test/AnalyzerTest.kt (1528 lines) * src/test/kotlin/.../test/SemanticdbSymbolsTest.kt (726 lines) * src/test/kotlin/.../test/Utils.kt (203 lines) The Kotlin compiler plug-in behavior remains covered end-to-end by the existing snapshot suites (semanticdb-kotlinc/minimized fixtures + the exposed-core library snapshot regenerated in PR2 K5). Validation: sbt unit/test (28 passing), sbt snapshots/test (102 passing).
The aggregator now consumes SCIP shards only. The legacy SemanticDB-based reader/aggregator is removed. Wiring: * IndexSemanticdbCommand: remove the --use-scip-shards flag and the ScipSemanticdb.run() else branch; always call ScipShardAggregator. * BazelBuildTool: switch the Bazel main entry to ScipShardAggregator. * MinimizedSnapshotScipGenerator: drop the --use-scip-shards argument (the default switched in PR2 K4 and the flag is being removed now). * build.sbt (kotlincSnapshots): drop --use-scip-shards from the index-semanticdb invocation. Delete the legacy SemanticDB-consuming aggregator sources, none of which have any remaining callers: * ScipSemanticdb.java * SemanticdbWalker.java * SemanticdbTreeVisitor.java * ScipTextDocument.java * SignatureFormatter.java * SignatureFormatterException.java * SymbolOccurrences.java * Symtab.java * RangeComparator.java Validation: sbt unit/test (28 passing), sbt snapshots/test (102 passing).
- Remove generated SemanticDB protobuf module: - semanticdb-java/src/main/protobuf/semanticdb.proto - semanticdb-java/src/main/protobuf/BUILD - semanticdb-kotlinc/src/main/proto/.../semanticdb.proto - Delete unused SemanticDB builder helpers: - semanticdb-java/.../SemanticdbBuilders.java - semanticdb-kotlinc/.../SemanticdbBuilders.kt - Keep a minimal semanticdb-java module that only ships SemanticdbSymbols.java (a pure-Java symbol helper still consumed by semanticdb-javac and scip-semanticdb), without protobuf generation. - Update sbt and Bazel build files accordingly.
The Java/Kotlin compiler plugins now emit per-file SCIP shards directly and the 'index-semanticdb' command aggregates those shards into a single SCIP index. Update user-facing strings and docs to describe the actual behavior instead of the now-removed SemanticDB->SCIP conversion step. Keep compatibility names (Xplugin:semanticdb, index-semanticdb CLI, semanticdb-targetroot directory, semanticdb-javac module/package) so existing build integrations keep working.
b8b50ae to
9470838
Compare
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.
Part 2 of a 2-PR split of #891. Stacked on #896.
What this PR does
Finishes the SemanticDB → SCIP migration on the Kotlin side, removes the now-unused SemanticDB consumer fallback and protobuf machinery, scrubs SemanticDB wording from docs, and applies four small simplifications that became possible once the legacy SemanticDB visitors were gone.
Pipeline before vs after this PR
Commits
10 commits:
semanticdb-kotlincemits only SCIP shards (dropsSemanticdbVisitor.kt/SemanticdbTextDocumentBuilder.kt/SemanticdbBuilders.ktand associated tests).ScipSemanticdb,SignatureFormatter,SemanticdbTreeVisitor, etc. — ~1.8 KLOC).semanticdb.protoin bothsemanticdb-javaandsemanticdb-kotlinc,SemanticdbBuilders.java, plus the now-unusedsemanticdb-javaprotobuf wiring inbuild.sbt).docs/,CONTRIBUTING.md,build.sbt, plus removing a danglingpipeline.svgreference and the now-obsolete "Why per-file SCIP shards?" section.ScipOccurrencesto a stateful accumulator (Java + Kotlin), drop the redundantScipRoleenum, inline one-call wrappers, prune dead helpers (e.g.MD5.java,TargetPaths.java, remnants of the oldCompilerRangeenum), andLinkedHashSet-ify relationship dedup.Net code change
~3,920 added / ~8,477 removed across ~105 files. Bulk is deletions (legacy SemanticDB output code, tests for that code, and the protobuf-driven
scip-semanticdbaggregator).Validation
sbt checkAll✅sbt unit/test✅ 28/28sbt minimized/{clean,compile}✅sbt snapshots/test✅ 23/23sbt semanticdbKotlincMinimized/clean kotlincSnapshots✅ (no snapshot drift)