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

Method _handle_unresolved_call_legacy

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

处理无法解析的函数调用(旧版本)

(
        &self,
        call_name: &str,
        call_file: &PathBuf,
        call_line: usize,
        functions: &[FunctionInfo],
        code_graph: &mut CodeGraph
    )

Source from the content-addressed store, hash-verified

1121
1122 /// 处理无法解析的函数调用(旧版本)
1123 fn _handle_unresolved_call_legacy(
1124 &self,
1125 call_name: &str,
1126 call_file: &PathBuf,
1127 call_line: usize,
1128 functions: &[FunctionInfo],
1129 code_graph: &mut CodeGraph
1130 ) {
1131 // 查找调用者函数
1132 if let Some(caller_idx) = self._find_caller_function_by_line(call_file, call_line, functions) {
1133 let caller = &functions[caller_idx];
1134 // 创建一个未解析的调用关系
1135 let relation = CallRelation {
1136 caller_id: caller.id,
1137 callee_id: uuid::Uuid::new_v4(), // 临时ID
1138 caller_name: caller.name.clone(),
1139 callee_name: call_name.to_string(),
1140 caller_file: caller.file_path.clone(),
1141 callee_file: call_file.clone(),
1142 line_number: call_line,
1143 is_resolved: false,
1144 };
1145 code_graph.add_call_relation(relation);
1146 }
1147 }
1148
1149 /// 根据函数名查找函数
1150 fn _find_function_by_name(&self, name: &str) -> Option<&FunctionInfo> {

Callers 1

Calls 3

to_stringMethod · 0.80
add_call_relationMethod · 0.45

Tested by

no test coverage detected