You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(index): Ruby methods in modules and classes nested in modules are not indexed #791
Two gaps in the Tree-sitter extractor for Ruby (src/index/ast.rs), both hidden by the module-wide #[allow(dead_code, unused)] that was removed in #798:
Methods inside a module are never indexed. The match has two "module" arms; the first only records the module and shadows the second, which also extracts the methods (unreachable pattern).
Classes and modules nested inside a module or class are never visited.walk_ruby runs on the direct children of the file root only, so the usual layout module Sinatra; class Base; def halt ... end; end; end indexes the module and nothing inside it.
Why
Ruby code puts most of its classes and methods inside modules (gems, Rails concerns, service modules), so search, callers and impact analysis miss a large part of a Ruby project. Measured on Sinatra (147 Ruby files): 79 methods indexed, and def halt (inside class Base inside module Sinatra) is not found.
Testing
Tests first, red before the fix: methods of a module are indexed with the module as parent; a class nested in a module, a module nested in a module and the methods of the nested class are indexed; class methods keep working.
Measured on Sinatra before and after: indexed methods, classes and modules, index time, and cora explore halt.
cargo test --features tree-sitter, cargo fmt --all -- --check and clippy with -D warnings stay green.
changed the title [-]fix(index): methods defined inside a Ruby module are not indexed[/-][+]fix(index): Ruby methods in modules and classes nested in modules are not indexed[/+]on Nov 17, 2026
Activity
[-]fix(index): methods defined inside a Ruby module are not indexed[/-][+]fix(index): Ruby methods in modules and classes nested in modules are not indexed[/+]