MCPcopy Create free account
hub / github.com/CodeBendKit/codeseek / _extract_function_info

Method _extract_function_info

rust-core/src/codegraph/parser.rs:473–497  ·  view source on GitHub ↗

从AST符号提取函数信息

(
        &self,
        symbol: &dyn crate::codegraph::treesitter::ast_instance_structs::AstSymbolInstance,
        file_path: &PathBuf,
        namespace: &str,
        language: &str,
    )

Source from the content-addressed store, hash-verified

471
472 /// 从AST符号提取函数信息
473 fn _extract_function_info(
474 &self,
475 symbol: &dyn crate::codegraph::treesitter::ast_instance_structs::AstSymbolInstance,
476 file_path: &PathBuf,
477 namespace: &str,
478 language: &str,
479 ) -> FunctionInfo {
480 let name = symbol.name().to_string();
481 let line_start = symbol.full_range().start_point.row + 1;
482 let line_end = symbol.full_range().end_point.row + 1;
483
484 // 尝试提取函数签名
485 let signature = self._extract_function_signature(symbol);
486
487 FunctionInfo {
488 id: Uuid::new_v4(),
489 name,
490 file_path: file_path.clone(),
491 line_start,
492 line_end,
493 namespace: namespace.to_string(),
494 language: language.to_string(),
495 signature,
496 }
497 }
498
499 /// 从AST符号提取类信息
500 fn _extract_class_info(

Callers 1

parse_fileMethod · 0.80

Calls 4

to_stringMethod · 0.80
nameMethod · 0.80
full_rangeMethod · 0.80

Tested by

no test coverage detected