Skip to main content

find_constructor_references

Function find_constructor_references 

Source
pub fn find_constructor_references(
    short_name: &str,
    all_docs: &[(Url, Arc<ParsedDoc>)],
    class_fqn: Option<&str>,
) -> Vec<Location>
Expand description

Find only new ClassName(...) instantiation sites across all docs.

Used by the __construct references handler — SymbolKind::Class (the normal class-kind path) is too broad because mir’s ClassReference key covers type hints, instanceof, extends, and implements in addition to new calls. This function walks the AST using new_refs_in_stmts which only emits spans for ExprKind::New nodes, giving the caller exactly the call sites.

class_fqn is the fully-qualified name (e.g. "Alpha\\Widget") used to filter files where the short name resolves to a different class. Pass None for global-namespace classes.