docs: handle properties/signals when looking for a method
@@ -120,6 +120,9 @@ fn replace_c_types(entry: &str, env: &Env, _in_type: &str) -> String {
fn find_method_or_type(type_: &str, method_name: Option<&str>, env: &Env) -> Option<String> {
let symbols = env.symbols.borrow();
if let Some(method) = method_name {
+ let is_signal = method.starts_with("::");
+ let is_property = !is_signal && method.starts_with(':');
+ if !is_signal && !is_property {
if let Some((obj_info, fn_info)) = env.analysis.find_object_by_function(
env,
|o| o.full_name == type_,
@@ -144,6 +147,21 @@ fn find_method_or_type(type_: &str, method_name: Option<&str>, env: &Env) -> Opt
warn!("Method `{}` of type `{}` was not found", method, type_);
None
}
+ } else {
+ env.analysis
+ .objects
+ .values()
+ .find(|o| o.full_name == type_)
+ .map(|info| {
+ let sym = symbols.by_tid(info.type_id).unwrap(); // we are sure the object exists
+ let name = method.trim_start_matches(':');
+ if is_property {
+ format!("`property::{}::{}`", sym.full_rust_name(), name)
+ } else {
+ format!("`signal::{}::{}`", sym.full_rust_name(), name)
+ }
+ })
+ }
} else {
find_type(type_, env)
}
