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§
- Mutation
Result - Result of a mutation operation.
- Node
Kind - tree-sitter AST node kind identifier.
- NodeRef
- A self-contained reference to a node in a source file.
- Relative
Path - Source file path relative to project root.
- Remove
Result - Result of a node removal — modified source and the extracted node text.
Enums§
- Insert
Position - 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.