pub fn parse_import_layout(content: &str) -> ImportLayoutExpand description
Parse the import layout of a Python source file.
Tries AST-based parsing first (via rustpython-parser); falls back to a
simpler line-scan if the file has syntax errors (e.g. during active
editing).
The returned ImportLayout contains:
groups— classified contiguous import blocks with line ranges,from_imports/bare_imports— individual import statements,lines— the file lines (forTextEditcharacter-length lookups).