Skip to main content

Module apply_fragment

Module apply_fragment 

Source
Expand description

Constrained freeform fragment apply (#2018).

Covers Morph-class jobs (lazy snippets, freeform placement) without a Morph clone: Morph-style // ... existing code ... markers are stripped, but placement anchors are required and matching is fail-closed.

Structs§

ApplyFragmentSpec
Validated apply-fragment request (anchors required; no free guess).
DesugaredReplace
Fields for building Operation::Replace / replace_text from apply.fragment.

Enums§

FragmentPlacement
Placement for a cleaned fragment. Exactly one mode must be chosen.

Functions§

build_apply_fragment_spec
Build a validated spec from raw Morph-style inputs.
desugar_to_replace_fields
Desugar a validated spec into replace old + optional insert_after/before + new text.
desugar_to_replace_operation
Build a plan crate::plan::Operation::Replace from a validated apply.fragment spec.
is_lazy_marker_line
True when a line is a Morph-style lazy placeholder (not real source).
plan_apply_fragment_to_replace
Validate raw apply.fragment plan fields and desugar to Operation::Replace.
strip_lazy_markers
Remove Morph-style lazy marker lines; preserve other content and dominant EOL.