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

Method _find_caller_function

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

查找调用者函数

(&self, file_path: &PathBuf, call_line: usize, function_ids: &'a [Uuid])

Source from the content-addressed store, hash-verified

229
230 /// 查找调用者函数
231 fn _find_caller_function<'a>(&self, file_path: &PathBuf, call_line: usize, function_ids: &'a [Uuid]) -> Option<&'a Uuid> {
232 // 根据行号范围查找包含调用行的函数
233 for function_id in function_ids {
234 if let Some(function) = self._get_function_by_id(function_id) {
235 if function.file_path == *file_path &&
236 call_line >= function.line_start &&
237 call_line <= function.line_end {
238 return Some(function_id);
239 }
240 }
241 }
242 None
243 }
244
245 /// 根据ID获取函数信息
246 fn _get_function_by_id(&self, function_id: &Uuid) -> Option<&FunctionInfo> {

Callers 1

_analyze_file_callsMethod · 0.45

Calls 1

_get_function_by_idMethod · 0.80

Tested by

no test coverage detected