Skip to content

feat(index): resolve parent_id via line-range containment#229

Merged
emesal merged 4 commits into
devfrom
feature/lang-rust-plugin-2603
Mar 16, 2026
Merged

feat(index): resolve parent_id via line-range containment#229
emesal merged 4 commits into
devfrom
feature/lang-rust-plugin-2603

Conversation

@emesal
Copy link
Copy Markdown
Owner

@emesal emesal commented Mar 16, 2026

Summary

  • Two-pass insert_symbols in indexer.rs: first pass inserts all symbols with parent_id = NULL, second pass resolves parent names by matching name + smallest enclosing line range
  • Backwards-compatible — plugins that don't emit parent work exactly as before
  • Prepares chibi-core for language plugins that emit parent-child symbol hierarchies (specifically lang_rust)

Test Plan

  • insert_symbols_resolves_parent_id — verifies struct/impl disambiguation via line-range containment
  • insert_symbols_no_parent_still_works — backwards compat: no parent field → parent_id stays NULL
  • insert_symbols_unresolvable_parent_stays_null — unmatched parent name → graceful NULL + eprintln warning

emesal added 4 commits March 16, 2026 14:07
Two-pass insert_symbols: first pass inserts with NULL parent_id and
collects metadata, second pass resolves parent names by matching
name + smallest enclosing line range. Backwards-compatible — plugins
that don't emit parent field work exactly as before.

Prepares chibi-core for language plugins that emit parent-child
symbol hierarchies.
@emesal emesal merged commit 55b29ce into dev Mar 16, 2026
18 checks passed
@emesal emesal deleted the feature/lang-rust-plugin-2603 branch March 16, 2026 15:29
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