Skip to main content

Crate amql_mutate

Crate amql_mutate 

Source
Expand description

Pure source code mutation operations.

All functions are pure: source text + node references in, modified source + updated node references out. No file I/O happens here — callers are responsible for reading/writing files.

Structs§

MutationResult
Result of a mutation operation.
NodeKind
tree-sitter AST node kind identifier.
NodeRef
A self-contained reference to a node in a source file.
RelativePath
Source file path relative to project root.
RemoveResult
Result of a node removal — modified source and the extracted node text.

Enums§

InsertPosition
Position relative to a target node for insertion.

Functions§

insert_source
Insert source text relative to a target node.
move_node
Move a node to a new position relative to a target. Both nodes must be in the same file (same source text).
remove_node
Remove a node from the source text, returning the modified source and the detached node’s text.
replace_node
Replace a node’s source text with new content.