Skip to main content

patch_symbol_in_file

Function patch_symbol_in_file 

Source
pub fn patch_symbol_in_file(
    file_path: &Path,
    symbol_name: &str,
    new_content: &str,
    db_path: &Path,
) -> Result<PatchResult>
Expand description

Patch a symbol with new content.

Resolves the symbol via MagellanIntegration, then applies a span-safe byte replacement. The file is modified in place.

ยงErrors

Returns SpliceError::SymbolNotFound if the symbol cannot be resolved. Returns SpliceError::InvalidSpan if the byte span is out of bounds.