Skip to content

Skip parent relationships without an indexable symbol - #266

Open
mindaugasrukas wants to merge 1 commit into
sourcegraph:scip-ruby/masterfrom
mindaugasrukas:fix/skipped-parent-relationships
Open

mindaugasrukas wants to merge 1 commit into
sourcegraph:scip-ruby/masterfrom
mindaugasrukas:fix/skipped-parent-relationships

Conversation

@mindaugasrukas

Copy link
Copy Markdown

Propagate the symbol writer's success status when saving parent relationships, and omit relationships whose target symbol is skipped. Keep the existing nonempty-symbol assertion for successful writes.

Motivation

saveSymbolString can legitimately return a skip result when a parent has no indexable source location. The callback used by saveParentRelationships currently discards that result, then attempts to add a relationship with an empty target and triggers !rel.symbol().empty().

The included regression reproduces the assertion with:

# typed: true

describe "example" do
  before { @value = 1 }
end

@value

Return status.ok() through the callback and stop constructing that relationship when it returns false.

Test plan

  • Confirmed the regression triggers the empty-relationship-symbol assertion before the fix.
  • Added a snapshot test for the reproduction above.
  • Ran ./bazel test --config=dev --jobs=6 //test/scip with this patch alone: all 60 tests passed, including existing inheritance and mixin snapshots.
  • Built //main:scip-ruby with --config=dev.

Validation ran on macOS ARM64 using the macOS 14.4 SDK with the repository's LLVM 15 toolchain; the SDK selection was local to the validation checkout and is not part of this patch.

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.

1 participant