MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / convert_deleted_line

Method convert_deleted_line

atomic-core/src/diff/semantic_to_crdt.rs:398–414  ·  view source on GitHub ↗

Convert a deleted line to LineOps.

(
        &mut self,
        line_num: usize,
        _line: &SemanticLine<'a>,
        tokens: &[TokenChange<'a>],
    )

Source from the content-addressed store, hash-verified

396
397 /// Convert a deleted line to LineOps.
398 fn convert_deleted_line<'a>(
399 &mut self,
400 line_num: usize,
401 _line: &SemanticLine<'a>,
402 tokens: &[TokenChange<'a>],
403 ) -> ConversionResult<Vec<LineOps>> {
404 let branch_id = self.allocator.alloc_branch();
405
406 // Store the original content as LeafOps for diff display
407 let content_ops = self.convert_tokens_to_inserts(tokens)?;
408
409 let line_ops = LineOps::delete(branch_id, content_ops).with_old_line_num(line_num);
410
411 self.stats.lines_deleted += 1;
412
413 Ok(vec![line_ops])
414 }
415
416 /// Convert a modified line to LineOps.
417 ///

Callers 1

convert_line_changeMethod · 0.80

Calls 3

alloc_branchMethod · 0.80
with_old_line_numMethod · 0.45

Tested by

no test coverage detected