Expand description
Scope-aware reference resolver using tree-sitter ASTs.
Instead of bag-of-words tokenization (current graph.rs Pass 2), this module walks the tree-sitter AST to find actual reference nodes (calls, attribute access) and resolves them using scope chains. This gives compiler-like accuracy for name resolution without needing a full language server.
Key improvements over bag-of-words:
- Distinguishes definitions from references in the AST
- Resolves same-name entities via scope chains (no false collisions)
- Tracks variable types through assignments (x = Foo() → x.method → Foo.method)
- Uses AST structure, not string matching
Structs§
- Resolution
Entry - Scope
- A scope in the scope tree. Scopes are nested: module -> class -> function -> block.
- Scope
Result - Result of scope-aware resolution
Functions§
- extract_
go_ receiver_ type - Parse Go receiver type from method content:
func (r *ReceiverType) Name(...) - resolve_
with_ scopes - Public API — preserves the original 5-parameter signature for semver compatibility.