Skip to content

feat: emit typed SCIP ranges instead of the deprecated packed encoding - #545

Merged
christoph-sg merged 1 commit into
mainfrom
emit-typed-ranges
Nov 11, 2026
Merged

christoph-sg merged 1 commit into
mainfrom
emit-typed-ranges

Conversation

@christoph-sg

Copy link
Copy Markdown
Contributor

scip.proto deprecated the packed repeated int32 range / enclosing_range fields on Occurrence in favor of the typed_range / typed_enclosing_range oneofs (SingleLineRange / MultiLineRange), and says new producers should set only the typed form. This switches scip-typescript over: Range is now what SourceInfo and FileIndexer pass 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 syntax and svelte fixtures to confirm every occurrence carries a typed range and none carry the deprecated fields, and scip snapshot (scip CLI v0.10.0) output is identical between main and this branch for both fixtures.

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
christoph-sg merged commit 0c42f33 into main Nov 11, 2026
5 checks passed
@christoph-sg
christoph-sg deleted the emit-typed-ranges branch November 11, 2026 20:42
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.

2 participants