Skip to main content

apply_structural

Function apply_structural 

Source
pub fn apply_structural(doc: &CstDocument, op: StructuralOp) -> TransformOutcome
Expand description

Apply one named structural StructuralOp to doc, returning a TransformOutcome.

The original doc is never mutated. On TransformOutcome::Applied the returned document shares every untouched green subtree with doc, so all untouched regions print byte-for-byte identically (FR-013) and surviving siblings keep their comments / blank lines / trailing commas (FR-021). On TransformOutcome::Blocked no edit is made and doc is unchanged.