review-copilot
Version:
ReviewCopilot - AI-powered code review assistant with customizable prompts
27 lines (26 loc) • 972 B
TypeScript
import { ParsedDiff } from '../providers/provider.types';
/**
* Parse a unified diff string into structured data
*/
export declare function parseDiff(diffString: string, filePath: string): ParsedDiff;
/**
* Find the position in diff for a specific line number
*/
export declare function findDiffPosition(parsedDiff: ParsedDiff, targetLine: number): number | null;
/**
* Get context around a specific line in the diff
*/
export declare function getDiffContext(parsedDiff: ParsedDiff, targetLine: number, contextLines?: number): string;
/**
* Extract all modified lines from a diff that could be candidates for review comments
*/
export declare function getReviewableLines(parsedDiff: ParsedDiff): Array<{
line: number;
content: string;
position: number;
context: string;
}>;
/**
* Check if a line number exists in the diff and can receive comments
*/
export declare function isLineCommentable(parsedDiff: ParsedDiff, lineNumber: number): boolean;