Skip to main content

parse_file

Function parse_file 

Source
pub fn parse_file(path: &Path) -> Result<Vec<CodeNode>>
Expand description

Parses a source file and extracts all code nodes.

This is the main entry point for parsing. It handles:

  • Reading the file from disk
  • Detecting the language from the extension
  • Parsing with Tree-sitter
  • Extracting meaningful code entities

ยงExample

use arbor_core::parse_file;
use std::path::Path;

let nodes = parse_file(Path::new("src/lib.rs")).unwrap();
println!("Found {} nodes", nodes.len());