1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Source reconstruction helpers for incremental edits
//!
//! Provides [`build_modified_source`], a zero-fuss utility for producing a new
//! source string by replacing a byte range with replacement text. Used by the
//! incremental parsing path to materialize edited documents.
use String;
use Range;
/// Build modified source with range replacement
///
/// Creates a new source string by replacing the specified range with new text.
///
/// # Arguments
///
/// * `original` - The original source text
/// * `range` - The byte range to replace
/// * `replacement` - The text to insert in place of the range
///
/// # Returns
///
/// A new string with the replacement applied