diff --git a/src/analysis/functions.rs b/src/analysis/functions.rs index 28926ae65..5a92999f8 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 { @@ -944,6 +946,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 08eda4c80..02c7cecf1 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)]"