feat(scip): resolve parent_symbol_id from SCIP descriptor chain#249
Merged
feat(scip): resolve parent_symbol_id from SCIP descriptor chain#249
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #249 +/- ##
==========================================
+ Coverage 87.97% 88.03% +0.05%
==========================================
Files 85 85
Lines 9580 9643 +63
Branches 2971 2991 +20
==========================================
+ Hits 8428 8489 +61
- Misses 1152 1154 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jafreck
added a commit
that referenced
this pull request
Mar 27, 2026
Merged
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.
Summary
The SCIP indexer now sets
parent_symbol_idfor every symbol that has an enclosing parent in the SCIP descriptor hierarchy.Previously
parent_symbol_idwas only populated by the tree-sitter extraction path, leaving itNULLfor all SCIP-indexed symbols. This meant theparent_namefields inlore_graph,lore_dependents, andlore_lookupreturned no data for SCIP-covered languages (Java, Go, Python, Rust, C#, etc.).Approach
SCIP symbol strings encode a descriptor chain that naturally represents the containment hierarchy. The parent of any symbol is obtained by stripping the last descriptor.
Symbols are sorted by descriptor depth (shallowest first) before insertion, so parents are always in
scipToLoreIdbefore their children. The parent lookup walks up the chain past skipped intermediates (modules, type literals) until it finds a symbol that was actually inserted, then includes the resolvedparent_symbol_idin the originalINSERT— no separate UPDATE pass needed.Changes
extractParentScipSymbol()— strips the last SCIP descriptor to produce the parent symbol stringdescriptorDepth()— counts descriptors for depth-first insertion orderingfindDescriptorNameStart()— backward-walks descriptor boundariesparent_symbol_idinlineINSERT INTO symbolsnow includesparent_symbol_iddirectlyextractParentScipSymbolImpact
Indexing lore-self: 2036 / 7604 symbols gain
parent_symbol_id— methods (98%), enum members (100%), constructors (100%), and interface/class properties correctly link to their enclosing container.Testing