Conversation
Index symbol-to-proc method targets and keep keyword colons out of local ranges. Add snapshots for aliases, destructuring, keyword shorthand, and local scopes. The safe-navigation and union-receiver fixes from this source commit are already in the regression branch. Adapted-from: 4b3fdf4b9225a6d6a2a313332bfe48f77d55ecc0 Signed-off-by: Emi <emi@sourcegraph.com>
Enable RBS rewriting and diagnostic assertions in the SCIP harness, using Prism for RBS fixtures. Add valid and invalid annotation examples and document fixture settings. Both-parser checks remain in the regression branch. Adapted-from: 46735c4aabac2744cfe8e061c9627818a7a389d5 Signed-off-by: Emi <emi@sourcegraph.com>
Collect type aliases, type members, and method type parameters from the resolved AST using their semantic identities. Preserve navigation through signatures and RBS annotations even when CFG optimization removes aliases. Add multi-file and generic-type snapshots. Adapted-from: d1f290ab550f52ec8c89b3d57d5d443fcaf59816 Signed-off-by: Emi <emi@sourcegraph.com>
Retain source mappings for RBS type names, namespaces, aliases, and continuation lines. Suppress occurrences for generated T helpers and preserve the handwritten class receiver when expanding generic construction. Keep ordinary Sorbet locations unchanged. Adapted-from: 2333517cdb71f868f39ab3d3ebd9fa771fca572a Signed-off-by: Emi <emi@sourcegraph.com>
Render declaration hovers with class self types so generic members remain visible. Preserve keyword and block parameter names through RBS signature resolution and source generation. Cover Ruby and RBS method signatures. Adapted-from: 557f2f837e4e582c11a8ef02abbf1e6dcf7541df Signed-off-by: Emi <emi@sourcegraph.com>
Retain resolved keyword targets during dispatch and emit stable parameter symbols at declarations and call sites. Preserve local shorthand reads and Ruby/RBS parameter ranges, including cross-file calls and invalid-call coverage. Adapted-from: 7f6adc6b953132e7d8dd8a83af3ed275d712c238 Signed-off-by: Emi <emi@sourcegraph.com>
Retain the RBS intersection fixtures after moving receiver dispatch and Ruby coverage into the regression branch. Adapted-from: e3d45a5ef1b43a399eb35695e6352dd1bff45f76 Signed-off-by: Emi <emi@sourcegraph.com>
Add SCIP snapshots for assignment targets, block locals, callable returns, enum constants, and implicit it parameters inherited from upstream Sorbet. Adapted-from: d4aba7073a8aa8a7cacae222774265186d7b02fe Signed-off-by: Emi <emi@sourcegraph.com>
Preserve field-symbol identities when indexing constant aliases used as ancestor qualifiers, avoiding an invalid class-symbol conversion. Cover alias-based inheritance with SCIP snapshots. Adapted-from: 67769de3d5235f27e516de5608d14fe5ab607591 Signed-off-by: Emi <emi@sourcegraph.com>
Match an intrinsic stub without an arity only until its first real definition. Give later incompatible definitions distinct method symbols so AST parameter lists and symbols remain consistent. Add a namer regression for redefined intrinsics. Adapted-from: 360d648d13d2a1fc11ce6f8b205ce97d5f50c511 Signed-off-by: Emi <emi@sourcegraph.com>
Remember resolved class targets before alias redeclarations clear their cached types. Keep naming phases consistent in SCIP mode and cover reopened aliases, nested scopes, and method ownership. Adapted-from: 8ac870f319feb928af2ca907e1bbc41457e1eeb9 Signed-off-by: Emi <emi@sourcegraph.com>
Exercise parenthesized paths, unresolved aliases, and continued indexing after missing constants. The resolver implementation is already present in the replay base; this commit adds the SCIP coverage. Adapted-from: c9267302154bc4069ecdd809031940aad436d127 Signed-off-by: Emi <emi@sourcegraph.com>
Cover invalid attached-class declarations, inherited type members, Module subclasses, and valid factories. These tests exercise the resolver recovery already present in the replay base. Adapted-from: 217ad2f0b00fb2da587d63d1386903774d5d62ca Signed-off-by: Emi <emi@sourcegraph.com>
Use the existing T::Class result for module receivers retained by invalid-ancestor recovery during SCIP indexing. Keep the requires-ancestor assertion outside SCIP mode and cover direct and inherited receiver cases. Adapted-from: a2855251ebf33ee759c7b5565868a30fe0e3b7c1 Signed-off-by: Emi <emi@sourcegraph.com>
Preserve tuples and hash shapes when widening literal branches in SCIP unions. Keep tuple-to-array widening consistent and retain the existing subtype assertions. Add type-level and index snapshots with ordinary Sorbet controls. Adapted-from: e4a46437ef80920349f482b9ceca242e5aed6d77 Signed-off-by: Emi <emi@sourcegraph.com>
Keep hash shapes precise when rebuilding unions during distributed intersections, preserving the subtype invariant. Add type-level and indexing regressions while retaining ordinary Sorbet behavior. Adapted-from: a948ce029423df4351ed5e95e0b32fd5b826b7e5 Signed-off-by: Emi <emi@sourcegraph.com>
Retain computed intersection branches after impossible nested union components are eliminated. Build exact unions without widening aggregates and preserve existing subtype assertions. Add type-level and SCIP fixtures. Adapted-from: 434de54ef26a688ee21803e84dd19f7490a8a4c2 Signed-off-by: Emi <emi@sourcegraph.com>
Guard the final definition writer against missing or empty source locations and count skipped definitions. Inject a location-less definition in the test harness and verify that valid definitions and references still index with both parsers. Adapted-from: a3855bbf2c6185b3a0d5ebcfab72942846ad9a50 Signed-off-by: Emi <emi@sourcegraph.com>
Recombine distributed intersections without widening hash shapes, eliminate bottom and identical branches, and look up retained shape and tuple methods on Hash and Array. Keep ordinary Sorbet behavior unchanged and cover type-level invariants and SCIP output. Adapted-from: 09e84993356a615d03f26d22854383ee200df00e Signed-off-by: Emi <emi@sourcegraph.com>
Declare the framework DSL calls retained by the regression fixes in the Minitest and RSpec fixtures. Refresh the additional snapshots for scoped local symbols, specific constructor targets, and the integrated keyword/type/intersection coverage. Keep the improved type-alias hover in the legacy single-argument union fixture. All 122 snapshot fixtures pass with their configured parsers and diagnostic assertions. Signed-off-by: Emi <emi@sourcegraph.com>
Exercise global keyword-parameter symbols through guarded and parenthesized returns, nested blocks, lambda returns, and next. Include a positional-parameter control and hover snapshots. The shared operand-location and type handling is provided by the regression branch. Signed-off-by: Emi <emi@sourcegraph.com>
Honor skipped symbol generation for inherited fields and aliases instead of asserting or emitting an empty relationship. Preserve the affected file and all relationships with valid targets. Cover top-level RSpec setup fields, nested examples, and ordinary parent/mixin relationships; reject empty targets in snapshot validation. The former implementation fails the new fixture; all 128 SCIP fixtures pass with both parsers. Signed-off-by: Emi <emi@sourcegraph.com>
Delegate comparator blocks to normal Array dispatch so inference receives block parameter types and the deferred result type. Keep the tuple shortcut for calls without a block. Cover min/max, counted results, empty tuples, comparator references, and precise no-block results. The former indexer asserts on the fixture; both parsers now pass. Signed-off-by: Emi <emi@sourcegraph.com>
Calls such as instance.sig can report an unknown method without providing a class to extend. Skip the class edit when that class or its singleton is unavailable, preserving the original diagnostic and continued indexing. Cover missing instance DSL methods and ordinary class-level T::Sig use with both parsers. Signed-off-by: Emi <emi@sourcegraph.com>
Keep an explicit intersection when merging a covariant ancestor would change an invariant or fixed subclass argument. This prevents constructing an invalid subtype while preserving method navigation from both constraints. Restrict recovery to SCIP mode and retain existing same-class refinement. Cover both operand orders, union narrowing, ordinary covariance, and method/hover output; bump the SCIP cache identity for the changed resolved types. Signed-off-by: Emi <emi@sourcegraph.com>
Append scip-ruby to a nonempty configured cache directory before cache cleanup or creation. This separates SCIP from Sorbet when both inherit --cache-dir from sorbet/config, while keeping caching disabled by default. Document the effective directory in the SCIP CLI reference.
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.
Based on #262
In #261 we produced a PR that successfully builds a scip-ruby binary after replaying all commits on-top of latest upstream Sorbet version. And in #262 we addressed all of the regressions that resulted from us fast-forwarding 2 years and ~2k commits to get to upstream Sorbet. During indexing of ~400 Ruby repositories, however, we identified a handful of areas for improvement: not regressions, but crashes and bugs that existed before any of these changes.
Many of these fixes were identified during review of indexing bugs for one of our customers' who uses Sorbet extensively.
After this PR, the ~400 Ruby repositories I verified indexing against no longer exhibit these issues:
--cache-dir=Xnow places SCIP’s cache inX/scip-ruby/, so the two tools do not invalidate each other’s caches when inheriting the same configuration.The PR contains 26 commits across 138 files:
90.7% of added/removed lines are tests, infrastructure, build files, or documentation. Test snapshot files alone account for +5,501 / −27.
Motivation
Same motivation as #261 and #262 — update scip-ruby to latest Sorbet version.
Test plan
New tests added.
Confidence comes from comparing actual navigation against the old indexer (eaa63a4) and #262, adding focused regression tests, and running the existing test suite.
I tested indexing across ~400 Ruby repositories which use Sorbet. The last full corpus run completed 374 of 406 repository/revision runs producing parseable indexes with no indexer crashes, internal errors, or timeouts among the included runs: 93 more completed repositories than branch 2. The remaining 32 runs failed because of configuration/input issues.
Comparing the resulting SCIP indexes against the old indexer and #262 found no additional unexplained navigation losses in the completed comparisons. I used an agent to analyze and compare resulting SCIP indexes.