diff --git a/src/analysis/functions.rs b/src/analysis/functions.rs index 8b201e044..97429de35 100644 --- a/src/analysis/functions.rs +++ b/src/analysis/functions.rs @@ -98,6 +98,8 @@ pub struct Info { /// this potential global function is defined pub ns_id: NsId, pub generate_doc: bool, + pub get_property: Option, + pub set_property: Option, } impl Info { @@ -942,6 +944,8 @@ fn analyze_function( hidden: false, ns_id, generate_doc, + get_property: func.get_property.clone(), + set_property: func.set_property.clone(), } } diff --git a/src/codegen/function.rs b/src/codegen/function.rs index 03ee417b7..13c0521ae 100644 --- a/src/codegen/function.rs +++ b/src/codegen/function.rs @@ -106,6 +106,16 @@ pub fn generate( if analysis.codegen_name() != analysis.func_name { doc_alias(w, &analysis.func_name, comment_prefix, indent)?; } + if let Some(get_property) = &analysis.get_property { + if get_property != analysis.codegen_name() { + doc_alias(w, get_property, comment_prefix, indent)?; + } + } + if let Some(set_property) = &analysis.set_property { + if set_property != analysis.codegen_name() { + doc_alias(w, set_property, comment_prefix, indent)?; + } + } // Don't add a guard for public or copy/equal functions let dead_code_cfg = if !analysis.visibility.is_public() && !analysis.is_special() { "#[allow(dead_code)]"