Skip to main content

Module edit

Module edit 

Source
Expand description

Shared edit engine: byte-offset conversion, content replacement, syntax validation, and auto-backup orchestration.

Used by write, edit_symbol, edit_match, and batch commands.

Structs§

DryRunResult
Result of a dry-run diff computation.
WriteResult
Result of the write → format → validate pipeline.

Functions§

auto_backup
Snapshot the file into the backup store before mutation.
dry_run_diff
Compute a unified diff between original and proposed content, plus syntax validation.
is_dry_run
Extract the dry_run boolean from request params.
line_col_to_byte
Convert 0-indexed line/col to a byte offset within source.
replace_byte_range
Replace bytes in [start..end) with replacement.
validate_syntax
Validate syntax of a file using a fresh FileParser (D023).
validate_syntax_str
Validate syntax of an in-memory string without touching disk.
write_format_validate
Write content to disk, auto-format, then validate syntax.