Skip to content

Commit

Permalink
Merge pull request #1575 from gtk-rs/bilelmoussaoui/docs-enum
Browse files Browse the repository at this point in the history
codegen: Handle mangled types names
  • Loading branch information
sdroege committed Jun 3, 2024
2 parents e0d63f0 + d772c7d commit 9b36669
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/codegen/doc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,18 @@ macro_rules! impl_to_stripper_type {
fn to_stripper_type(&self) -> TypeStruct {
TypeStruct::new(
SType::$enum_var,
&format!("connect_{}", nameutil::signal_to_snake(&self.name)),
&format!(
"connect_{}",
nameutil::mangle_keywords(nameutil::signal_to_snake(&self.name))
),
)
}
}
};
($ty:ident, $enum_var:ident) => {
impl ToStripperType for $ty {
fn to_stripper_type(&self) -> TypeStruct {
TypeStruct::new(SType::$enum_var, &self.name)
TypeStruct::new(SType::$enum_var, &nameutil::mangle_keywords(&self.name))
}
}
};
Expand Down Expand Up @@ -860,7 +863,7 @@ where

let mut st = fn_.to_stripper_type();
if let Some(name_override) = name_override {
st.name = name_override;
st.name = nameutil::mangle_keywords(name_override).to_string();
}
let ty = TypeStruct { parent, ..st };
let self_name: Option<String> = fn_
Expand Down

0 comments on commit 9b36669

Please sign in to comment.