Skip to main content

Module resolver

Module resolver 

Source
Expand description

Python’s reference resolution: export-name and seed inference, receiver-type resolution, and annotation candidates.

index arguments below are the dispatching analyzer’s CodeUnitIndex (see PythonGraphSource); python is the Python analyzer’s memoized products.

Functions§

annotation_class_qualifier_site
Return the exact qualifier token when a class target owns part of a structured annotation attribute chain.
annotation_class_qualifier_sites
Class qualifiers in lexical order. The lazy walk preserves the singleton lookup’s early stop, while a batched scan resolves the shared path once.
annotation_reference_candidates
Resolve a structured Python annotation reference.
annotation_reference_candidates_at_focus
Resolve only the annotation identifier selected by one definition request. Quoted annotations are reparsed with original byte coordinates, while the original syntax node remains the lexical class-scope anchor.
infer_export_names
infer_usage_seeds
member_name
normalized_receiver_type
receiver_annotation_matches_target
resolve_callable_parameter_default_types
Resolve the class in the nearest enclosing callable parameter default.
resolve_constructor_types
Resolve the class constructed by a Python call callee without interpreting source text. Bare callees use the import binder or same-file declarations; qualified callees walk tree-sitter’s attribute fields back to a namespace import and append each attribute component structurally.
resolve_receiver_type
resolve_visible_named_import_candidates
Resolve every visible named-import binding for one local symbol.
target_owner_code_unit
top_level_identifier
The name under which target is bound in the innermost scope a file scan can reference. Only class owners are climbed: a target nested in a function is bound by its own identifier in that function’s body, never by the outer class’s or function’s name, so treating the outer name as the target’s binding attributes the outer declaration’s usages to the nested target (#3390).