Repository navigation
feat: emit typed SCIP ranges instead of the deprecated packed encoding - #545
Merged
Merged
Conversation
christoph-sg
enabled auto-merge (squash)
November 10, 2026 14:17
scip.proto deprecated Occurrence.range and enclosing_range in favor of the typed_range and typed_enclosing_range oneofs (SingleLineRange and MultiLineRange), and new producers should set only the typed form. scip-typescript now does that: Range stays the internal representation and is converted to the typed oneofs when occurrences are built. Consumers that only read the deprecated fields will see empty ranges. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1c5ba-4dcf-77b3-9490-80b05fa84a15
christoph-sg
force-pushed
the
emit-typed-ranges
branch
from
November 11, 2026 11:57
b1faa30 to
ed4cd24
Compare
kalanchan
approved these changes
Nov 11, 2026
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.
scip.proto deprecated the packed
repeated int32range/enclosing_rangefields onOccurrencein favor of thetyped_range/typed_enclosing_rangeoneofs (SingleLineRange/MultiLineRange), and says new producers should set only the typed form. This switches scip-typescript over:Rangeis now whatSourceInfoandFileIndexerpass around, and it's converted to the typed oneofs when occurrences are built (single-line whenever start and end share a line). Occurrence dedup and the snapshot formatter read the typed fields too.Consumers that only understand the deprecated fields (older Sourcegraph versions or scip tooling) will see empty ranges, so this needs consumers that read the typed form. Indexes get ~2.5% larger on the snapshot fixtures, in line with the schema's estimate.
Test plan
Snapshot outputs are unchanged. Decoded serialized indexes for the
syntaxandsveltefixtures to confirm every occurrence carries a typed range and none carry the deprecated fields, andscip snapshot(scip CLI v0.10.0) output is identical betweenmainand this branch for both fixtures.