Skip to main content

classify

Function classify 

Source
pub fn classify(
    view: &mut DiffView,
    config: &Config,
    attr_marked: &HashSet<Vec<u8>>,
    langs: &LanguageRegistry,
) -> Partition
Expand description

Apply classification hints and compute the mechanical partition.

The only place config and languages enter the pipeline. Both tune how hunks are described, never which ones exist (ADR 0012, ADR 0015).

The order of these two lines is load-bearing. partition reads file.generated as part of the class key, so the hints must be applied first. Getting it backwards would not fail: every file would read as not generated, and generated hunks would quietly rejoin source classes — the exact bug the key component was added to remove. The two calls are adjacent and this is their only caller, which is the guard.