Skip to main content

Module diff

Module diff 

Source
Expand description

Diff-aware context generation for code review and change understanding.

This module provides functionality to:

  • Parse git diff output to identify changed files
  • Find symbols affected by changes
  • Expand context using call graph analysis
  • Generate context focused on code changes

§Usage

let config = DiffConfig::default();
let result = diff_context("HEAD~1", &db, &analytics, config)?;
for file in result.changed_files {
    println!("{}: {:?}", file.path, file.change_type);
}

Structs§

AffectedSymbol
A symbol affected by changes.
ChangedFile
A changed file with metadata.
ContextFile
A file selected for context with relevance information.
DiffConfig
Configuration for diff-aware context generation.
DiffContext
Result of diff context analysis.
PrComment
A comment on a PR.
PrFile
A file changed in a PR.
PrInfo
PR information from GitHub.

Enums§

ChangeType
Type of change for a file.
ContextReason
Reason why a file is included in context.

Functions§

diff_context
Generate diff-aware context.
find_symbols_in_lines
Find symbols that were affected by changes in a file.
format_pr_header
Format PR info for context output.
format_summary
Format a summary of changes for output.
get_changed_files
Get the list of changed files for a revision.
get_pr_info
Get PR information using gh CLI.
is_git_repo
Check if current directory is a git repository.
parse_diff_output
Parse git diff –name-status output.