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

Method _resolve_qualified_function_name

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

解析限定函数名(如 Class.method, module.function)

(
        &self,
        qualified_name: &str,
        code_graph: &PetCodeGraph,
    )

Source from the content-addressed store, hash-verified

1312
1313 /// 解析限定函数名(如 Class.method, module.function)
1314 fn _resolve_qualified_function_name(
1315 &self,
1316 qualified_name: &str,
1317 code_graph: &PetCodeGraph,
1318 ) -> Option<FunctionInfo> {
1319 // 检查是否包含分隔符
1320 if let Some(dot_pos) = qualified_name.rfind('.') {
1321 let (prefix, method_name) = qualified_name.split_at(dot_pos);
1322 let method_name = &method_name[1..]; // 去掉点号
1323
1324 // 查找匹配的方法
1325 let candidates = code_graph.find_functions_by_name(method_name);
1326 for func in candidates {
1327 // 检查函数是否在指定的类/模块中
1328 if func.namespace.contains(prefix) || func.name == method_name {
1329 return Some(func.clone());
1330 }
1331 }
1332 }
1333
1334 None
1335 }
1336
1337 /// 创建未解析的调用关系
1338 fn _create_unresolved_call_relation(

Calls 1

Tested by 1