Skip to main content

project_with_trivia

Function project_with_trivia 

Source
pub fn project_with_trivia(
    prog: &Program,
    cst_items: &[CstNode<Item>],
    opts: &ProjectOptions,
) -> String
Expand description

Project a program with trivia preservation.

Given a CST (program with trivia), the projector interleaves comments and whitespace from the original source into the projected text. This is a best-effort process — structural edits may invalidate original trivia positions.