Skip to main content

parse_file

Function parse_file 

Source
pub fn parse_file(path: &Path, source: &str, language: Language) -> ProjectFile
Expand description

Parse a source file by dispatching to the appropriate language parser.

This is the primary entry point for parsing. It:

  1. Selects the parser for the given Language.
  2. Delegates to the parser’s Parser::parse method.
  3. Overwrites content_hash with a SHA-256 digest of source.
  4. On parser error, returns an empty ProjectFile with a tracing::warn log (graceful degradation).