@@ -178,10 +178,32 @@ fn func_tpl_pattern_match(
178178) -> Option < ( ) > {
179179 match target {
180180 LuaType :: DocFunction ( target_doc_func) => {
181- // todo
181+ for i in 0 ..doc_func. get_params ( ) . len ( ) {
182+ let param_type = & doc_func. get_params ( ) [ i] . clone ( ) . 1 ?;
183+ let target_param_type = & target_doc_func. get_params ( ) . get ( i) ?. clone ( ) . 1 ?;
184+ tpl_pattern_match ( db, config, root, param_type, target_param_type, result) ;
185+ }
186+
187+ for i in 0 ..doc_func. get_ret ( ) . len ( ) {
188+ let ret_type = & doc_func. get_ret ( ) [ i] ;
189+ let target_ret_type = & target_doc_func. get_ret ( ) . get ( i) ?;
190+ tpl_pattern_match ( db, config, root, ret_type, target_ret_type, result) ;
191+ }
182192 }
183193 LuaType :: Signature ( signature_id) => {
184- // todo
194+ let signature = db. get_signature_index ( ) . get ( & signature_id) ?;
195+
196+ for i in 0 ..doc_func. get_params ( ) . len ( ) {
197+ let param_type = & doc_func. get_params ( ) [ i] . clone ( ) . 1 ?;
198+ let target_param_type = & signature. param_docs . get ( & i) ?. type_ref ;
199+ tpl_pattern_match ( db, config, root, param_type, target_param_type, result) ;
200+ }
201+
202+ for i in 0 ..doc_func. get_ret ( ) . len ( ) {
203+ let ret_type = & doc_func. get_ret ( ) [ i] ;
204+ let target_ret_type = & signature. return_docs . get ( i) ?. type_ref ;
205+ tpl_pattern_match ( db, config, root, ret_type, target_ret_type, result) ;
206+ }
185207 }
186208 _ => { }
187209 }
0 commit comments