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_
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
attributefields 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
targetis 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).