pub fn parse_blocks(
line_changes_by_file: &HashMap<RepoPath, Vec<LineChange>>,
scan_mode: ScanMode,
file_system: &impl FileSystem,
path_checker: &impl PathChecker,
parsers: &LanguageParsers,
extra_file_extensions: &HashMap<OsString, OsString>,
) -> Result<ParsedBlocks>Expand description
Parses source files into the blocks a run should consider, together with the counts of files it looked at.
line_changes_by_filemaps file paths to sorted line changes.scan_modechooses which set of files is read; seeScanMode.file_systemprovides access to file contents within a root path.parsersmaps file extensions to language-specific block parsers.extra_file_extensionsallows remapping unknown extensions to supported ones (e.g., “cxx” -> “cpp”).
In either mode a file is read only if it passes the allow globs and is not ignored.
Fails if line_changes_by_file is invalid, e.g. it refers to files that do not exist.