Skip to main content

Module auto_import

Module auto_import 

Source
Expand description

Automatic import suggestion and insertion.

Detects unresolved symbols in a file and suggests imports from the project’s symbol index. Generates language-appropriate import statements and inserts at the correct position.

Internal API. add_import writes through apply_full_write_with_evidence and bypasses ADR-0009 role gates, audit sinks, and cache invalidation when called outside codelens-mcp dispatch. Route mutations through MCP — see the crate-level docs in lib.rs.

Structs§

ImportSuggestion
MissingImportAnalysis

Functions§

add_import
Add an import statement to a file at the correct position.
analyze_missing_imports
Analyze a file for potentially unresolved symbols and suggest imports. Results are cached by (file_path, content_hash) to avoid redundant parsing and lookups.