Audit and broaden snapshot coverage of indexer behavior.#251
Draft
jasonhawkharris wants to merge 1 commit into
Draft
Audit and broaden snapshot coverage of indexer behavior.#251jasonhawkharris wants to merge 1 commit into
jasonhawkharris wants to merge 1 commit into
Conversation
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.
Broaden snapshot coverage of indexer behavior
Adds 13 new snapshot fixtures under test/scip/testdata/ to cover indexer code paths that previously had no end-to-end test:
generics.rb— type_member, type_template, type_parametersprepend_extend.rb— prepend and user-level extend Mod (existing mixin.rb only covers include)singleton_class.rb— class << self definitions and class-instance variablesyield_block.rb— yield and yielded block params (YieldLoadArg / LoadYieldParams / YieldParamPresent)super_call.rb— explicit-arg super(...) (complementingimplicit_super_arg.rb)metaprog.rb— define_method, method_missing, respond_to_missing?typed_ignore.rbandtyped_strong.rb— sigils not previously snapshottedrequires_ancestor.rb— T::Helpers.requires_ancestort_helpers.rb— T.must, T.assert_type!, T.absurd, T.bind, T.type_aliasnested_constants.rb— 4-level constant qualifier walks in class names, ancestors, and references (exercises saveQualifierReferences recursion)abstract_interface.rb— abstract!, interface!, sealed!, mixes_in_class_methods (existing singleton.rb only covers final!)requires.rb— require from top-level and method bodies, plus require_relativeThis PR makes no changes to indexer code. It only adds fixtures and the snapshots they produce, locking in current behavior so future regressions are caught.
Several snapshots document existing behavior that may be worth follow-up fixes (intentionally captured as-is rather than silently changed):
SCIPSymbolRef.cc:95–103are unreachable.field_inheritance.rb).Motivation
Auditing the emission paths in
scip_indexer/SCIPIndexer.cc,SCIPSymbolRef.cc, andSCIPFieldResolve.ccsurfaced a number of distinct code paths — entire cfg::Tag cases, symbol kinds, and Ruby DSL constructs — that emit occurrences, symbols, or relationships but had no snapshot exercising them. That left the indexer with silent failure modes: a refactor or upstream Sorbet merge could change observable output for these constructs without any test catching it. This PR closes those gaps so the snapshot suite documents what the indexer actually does for each construct.Test plan
All 13 new fixtures pass under both ./bazel test --spawn_strategy=local //test/scip:update_ (snapshot generation) and ./bazel test //test/scip: (deterministic comparison). The full SCIP test suite (//test/scip:scip, 59 tests) passes.