Move interesting-lines detection into its own module.
Review Request #15214 — Created July 31, 2026 and updated
The scanning for "interesting lines" (function and class definition
headers shown on collapsed diff chunks) lived in theDiffer, driven by
regex tables in diffviewer/filetypes.py. This change moves it into a new
diffviewer.interesting_linesmodule, in preparation for detecting
these lines with tree-sitter.The new module hosts the regex tables, an
InterestingLinetype, and a
get_interesting_lines()entry point (currently regex-only).
DiffChunkGenerator.generate_chunks()now computes the interesting
lines for both file revisions directly, and_get_interesting_headers()
reads those instead of asking the differ.The legacy Differ API keeps working for third parties:
Differ.add_interesting_line_regex()is deprecated for removal in Review
Board 11.0 but still contributes results for now.Differ.get_interesting_lines()runs the regex scanner, since no parsed
tree is available at that layer.DiffChunkGeneratoris the supported
path going forward.filetypes.pyre-exportsHEADER_REGEXESandHEADER_REGEX_ALIASES
for backwards compatibility.
I've rewritten the interesting-lines tests as parameterized pytest cases
as part of this.
Ran unit tests.
| Summary | ID |
|---|---|
| sqsmuzqzzuovksrlvpssvkpxpvnvowsr |