MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / scan_file_full

Function scan_file_full

src/classmap_scanner.rs:133–141  ·  view source on GitHub ↗

Scan a single PHP file and return all discovered symbols (classes, functions, and constants). Returns an empty [`ScanResult`] when the file cannot be read or is empty.

(path: &Path)

Source from the content-addressed store, hash-verified

131/// Returns an empty [`ScanResult`] when the file cannot be read or is
132/// empty.
133pub fn scan_file_full(path: &Path) -> ScanResult {
134 let Ok(content) = std::fs::read(path) else {
135 return ScanResult::default();
136 };
137 if content.is_empty() {
138 return ScanResult::default();
139 }
140 find_symbols(&content)
141}
142
143/// Return the number of available CPU cores, capped at a sensible
144/// default. Used to size parallel scanning batches.

Callers

nothing calls this directly

Calls 2

find_symbolsFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected