Expand description
Python import syntax, binding, and FQN resolution.
Everything here is a free function over PythonSource; the
ImportAnalysisProvider impl that memoizes the per-file results stays on
PythonAnalyzer in analyzer/python/imports.rs.
Structs§
Enums§
Functions§
- extract_
package_ from_ python_ wildcard - module_
replacement_ of - parse_
python_ import_ bindings - Return source-ordered, parser-derived local bindings for explicit Python imports. The byte offset lets callers select the last visible binding rather than treating a whole document as one unordered import scope.
- parse_
python_ import_ infos - Parse the structured import facts for a Python document without executing it. LSP model binding uses the same AST-derived representation as the analyzer so external APIs are never selected by a terminal-name scan.
- python_
import_ details - python_
import_ infos_ from_ node - python_
namespace_ binding_ module - python_
namespace_ binding_ name - resolve_
exported_ fqn - resolve_
fqn_ candidates - Resolve a Python FQN with the cheapest semantically complete tier that can answer it. The direct reexport walk handles only proven, collision-free chains; ambiguous shapes use the ordered export index, and the exact lookup remains the final fallback for non-export symbols.
- resolve_
import - resolve_
import_ bindings - resolve_
imports_ batched - Resolves every import in
imports(file’s own imports), batching each import’s primary module FQN lookup (seeprimary_module_fqn) into one store transaction instead of one per import. Shared byresolve_import_bindingsandresolve_import_target_files, the two per-file “resolve everything” entry points – both are called once per candidate file by the usages candidate walker, so unbatched resolution here means one store transaction per import times every file in the workspace. - resolve_
python_ relative_ module - resolve_
python_ relative_ module_ from_ package - Resolve a structured Python module expression against an already-known
package identity. Dependency-pack producers know module identities without
owning a workspace
ProjectFile, so they use this entry point.