Skip to main content

validate_and_fix

Function validate_and_fix 

Source
pub async fn validate_and_fix(
    content: &str,
    _file_path: &str,
    _new_string: &str,
    _original_content: &str,
) -> ValidateResult
Expand description

Run all pre-write validations on the content in memory:

  1. Duplicate block detection
  2. Brace auto-fix
  3. HTML tag auto-fix

Returns a ValidateResult with the (possibly fixed) content. The caller should write fixed_content to disk, then optionally call post_edit_syntax_check for on-disk syntax validation. content is the post-edit content (what would be written to disk). original_content is the pre-edit content (for delta validation).