pub fn compute_file_diff(
file_id: FileId,
old_signature: Option<&FileSignature>,
new_signature: Option<&FileSignature>,
) -> CodebaseDiffExpand description
Computes the difference between an old file signature and a new file signature.
This function uses the Myers diff algorithm to efficiently identify changes between two versions of a file’s AST. Unlike Hakana which differentiates between signature and body changes, we use a single hash approach: any change triggers re-analysis.
§Arguments
file_id- The identifier of the file being compared (used fordiff_map)old_signature- The previous file signature (None if this is a new file)new_signature- The current file signature
§Returns
A CodebaseDiff containing:
keep: Symbols that are unchangedchanged: Symbols that are new, deleted, or modifieddiff_map: Position mappings for symbols that moveddeletion_ranges_map: Ranges of deleted code