Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCommentingRanges ¶
GetCommentingRanges determines which line ranges are valid for commenting For base file (left): only deleted lines are commentable For modified file (right): all changed lines are commentable
func MapNewPositionToOld ¶
MapNewPositionToOld maps a line number from the new file to the old file using the diff patch. Returns the old line number (1-based) or -1 if not found.
Types ¶
type CommentPosition ¶
type CommentPosition struct {
Line int // Current line number (1-based)
OriginalLine int // Original line number (1-based)
StartLine int // For multi-line comments
EndLine int // For multi-line comments
OriginalStartLine int // For multi-line comments
OriginalEndLine int // For multi-line comments
DiffSide DiffSide // Which side of the diff
IsOutdated bool // Whether the comment is on outdated code
}
CommentPosition represents the position of a comment in a diff
func CalculateCommentPosition ¶
func CalculateCommentPosition(line, originalLine int, diffHunk string, diffSide DiffSide) (*CommentPosition, error)
CalculateCommentPosition calculates the comment position from GitHub API data
Click to show internal directories.
Click to hide internal directories.