2
1
Fork 0

typegen: fix .s in type references

This commit is contained in:
outfoxxed 2024-07-21 15:34:54 -07:00
parent fe17f4adbb
commit 1f47b15963
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -650,13 +650,12 @@ fn parse_details(comment: Comment) -> String {
let separators = [ let separators = [
('$', true), ('$', true),
(' ', false), (' ', false),
('.', false),
(',', false), (',', false),
(';', false), (';', false),
(':', false), (':', false),
]; ];
let (end, ty) = src.chars().enumerate() let (mut end, mut ty) = src.chars().enumerate()
.find_map(|(i, char)| { .find_map(|(i, char)| {
separators.iter() separators.iter()
.find(|(sc, _)| char == *sc) .find(|(sc, _)| char == *sc)
@ -678,6 +677,11 @@ fn parse_details(comment: Comment) -> String {
prop prop
}) })
.unwrap_or(""); .unwrap_or("");
// special case for . as it is contained in valid types as well
if ty.ends_with('.') {
end -= 1;
ty = &ty[..ty.len() - 1];
}
let (prop, func, signal) = match member { let (prop, func, signal) = match member {
name if name.ends_with("()") => ("", &name[..name.len() - 2], ""), name if name.ends_with("()") => ("", &name[..name.len() - 2], ""),