MCPcopy Create free account
hub / github.com/douglance/devsql / extract_symbols_with_regex

Function extract_symbols_with_regex

crates/devsql/src/providers/symbols.rs:419–448  ·  view source on GitHub ↗
(
    language: &str,
    content: &str,
    file_path: &str,
    label: &str,
    next_id: &mut i64,
)

Source from the content-addressed store, hash-verified

417}
418
419fn extract_symbols_with_regex(
420 language: &str,
421 content: &str,
422 file_path: &str,
423 label: &str,
424 next_id: &mut i64,
425) -> Vec<SymbolRow> {
426 let matches = extract_symbols(language, content);
427 matches
428 .into_iter()
429 .map(|m| {
430 let id = *next_id;
431 *next_id += 1;
432 SymbolRow {
433 id,
434 file_path: file_path.to_string(),
435 name: m.name,
436 kind: m.kind,
437 line_start: m.line_start as i64,
438 line_end: m.line_end as i64,
439 signature: m.signature,
440 visibility: m.visibility,
441 parent_id: None,
442 parameters: String::new(),
443 return_type: String::new(),
444 language: label.to_string(),
445 }
446 })
447 .collect()
448}
449
450pub struct SymbolMatch {
451 pub name: String,

Callers 2

load_with_tree_sitterFunction · 0.85
load_with_regexFunction · 0.85

Calls 1

extract_symbolsFunction · 0.85

Tested by

no test coverage detected