spydecy_python/
type_extractor.rs1use crate::parser::PythonAST;
7use anyhow::Result;
8use spydecy_hir::types::Type;
9
10pub fn extract_type_hints(ast: &PythonAST) -> Result<Vec<(String, Type)>> {
16 let mut type_hints = Vec::new();
17
18 extract_type_hints_recursive(ast, &mut type_hints)?;
20
21 Ok(type_hints)
22}
23
24#[allow(clippy::unnecessary_wraps)]
25fn extract_type_hints_recursive(
26 _ast: &PythonAST,
27 _type_hints: &mut Vec<(String, Type)>,
28) -> Result<()> {
29 Ok(())
31}
32
33#[cfg(test)]
34mod tests {
35 use super::*;
36
37 #[test]
38 fn test_extract_type_hints() {
39 let ast = PythonAST::new("Module".to_string());
40 let result = extract_type_hints(&ast);
41 assert!(result.is_ok());
42 }
43}