Skip to main content

classify_review_line

Function classify_review_line 

Source
fn classify_review_line(
    line: &str,
    seen_quoted: bool,
    palette: &ColorPalette,
) -> Style
Expand description

Classify a line from a Sashiko inline review with context about whether we’ve seen quoted diff content yet.

Sashiko inline reviews have a three-part structure:

  1. Patch metadata/summary — unquoted lines before any >-quoted diff (commit hash, Author:, Subject:, description, Links). Styled as muted.

  2. Quoted diff — lines with > prefix containing patch content. Classified by diff role (green/red/cyan/bold/muted).

  3. Reviewer commentary — unquoted lines after the first >-quoted section. This is the AI review analysis. Styled as foreground.

The seen_quoted flag tracks whether any >-quoted line has been encountered. Before that, unquoted text is patch context. After, unquoted text is reviewer commentary.