Repository navigation
fix(index): index Ruby methods in modules and classes nested in modules - #801
Merged
Merged
Conversation
This was referenced Nov 17, 2026
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.
What
Three fixes in the Tree-sitter extractor for Ruby (
src/index/ast.rs):"module"arm, which only recorded the module, is removed; the second one, which also extracts the methods of the module, was unreachable and now runs (this also drops the targeted#[allow(unreachable_patterns)]added in refactor: remove the dead code hidden behind allow(dead_code) #798).walk_ruby_nested: the classes and modules nested in a class or module body are visited (onlyclassandmodulechildren, so a method is not indexed twice). Before, only the direct children of the file were walked.< Basebecause the text of thesuperclassnode starts with<, so the edge never matched the symbolBase.Why
Ruby code lives in
module Outer; class Inner; def run ... end; end; end, and none of it was indexed, sobrain,callersandimpactmissed most of a Ruby project; the missing methods were a compiler warning that a module-wideallowhid. Closes #791.Testing
Base; a class-methods test guards the existing behavior.corabuilt before and after:cora explore haltSinatra::Base#haltfoundThe index time stays in the same range (a fraction of a second).
cargo test --features tree-sitter: 1546 passed, 0 failed;cargo fmt --all -- --checkand clippy with-D warningsclean; Cora review of the staged diff: no findings.cora indexto pick this up; the CHANGELOG says so.