Skip to main content

Module post_edit

Module post_edit 

Source
Expand description

Deterministic post-edit actions: bounded indentation normalization for inserted/replaced code and host-provided formatter/validator hooks. These actions are tool-scoped; there are no session-level watcher loops.

Structs§

PostEditDiagnostic
PostEditHooks
PostEditOutcome
PostEditValidator
Host-provided validator callback: receives (path, content) and returns structured diagnostics. The attached policy decides whether diagnostics warn or block the edit.

Enums§

ValidatorPolicy

Functions§

normalize_inserted_indentation
Bounded indentation normalization for inserted/replaced multiline code.
run_post_edit_hooks
Run the optional formatter then validators over the edited content for one path. Formatter failures become diagnostics and leave content unchanged; validator behavior follows each validator’s policy.

Type Aliases§

FormatterHook
Host-provided formatter callback: receives (path, content) and returns Ok(Some(formatted)) to replace the content, Ok(None) to leave it unchanged, or Err for a formatter failure (reported as a diagnostic, never silently swallowed).