Skip to main content

Crate perl_source_editing

Crate perl_source_editing 

Source
Expand description

Source text editing heuristics.

This crate has a single responsibility: provide reusable source-text heuristics for insertion points and lightweight display helpers.

Functionsยง

find_import_insert_position
Find import insertion position after shebang and existing import/require lines.
find_pragma_insert_position
Find pragma insertion position (just after shebang if present).
find_statement_start
Find the start byte offset of the current statement at pos.
get_indent_at
Return indentation (leading spaces/tabs) for the line containing pos.
has_non_ascii_content
Return true when source contains non-ASCII content.
truncate_expr
Truncate an expression for display with ... suffix when required.