(language: &str, content: &str)
| 457 | } |
| 458 | |
| 459 | pub fn extract_symbols(language: &str, content: &str) -> Vec<SymbolMatch> { |
| 460 | match language { |
| 461 | "Rust" => extract_rust(content), |
| 462 | "TypeScript" | "TSX" | "JavaScript" | "JSX" => extract_ts_js(content), |
| 463 | "Python" => extract_python(content), |
| 464 | "Go" => extract_go(content), |
| 465 | _ => Vec::new(), |
| 466 | } |
| 467 | } |
| 468 | |
| 469 | fn line_number_at(content: &str, byte_offset: usize) -> usize { |
| 470 | content[..byte_offset].matches('\n').count() + 1 |
no test coverage detected