Skip to content

Commit

Permalink
fix: reflect */** prefix in rendered code/docs for args & kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenStaa committed Mar 15, 2024
1 parent 40bba6d commit eb11575
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions starlark/src/docs/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ impl<'a> RenderMarkdown for TypeRenderer<'a> {
DocParam::NoArgs => "*".to_owned(),
DocParam::OnlyPosBefore => "/".to_owned(),
DocParam::Args { typ, name, .. } => {
format!("{}{}", name, raw_type_prefix(": ", typ))
format!("*{}{}", name, raw_type_prefix(": ", typ))
}
DocParam::Kwargs { typ, name, .. } => {
format!("{}{}", name, raw_type_prefix(": ", typ))
format!("**{}{}", name, raw_type_prefix(": ", typ))
}
});

Expand Down
10 changes: 7 additions & 3 deletions starlark/src/docs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,13 @@ impl DocParam {
},
DocParam::NoArgs => "*".to_owned(),
DocParam::OnlyPosBefore => "/".to_owned(),
DocParam::Args { name, typ, .. } | DocParam::Kwargs { name, typ, .. } => match typ {
t if t.is_any() => name.clone(),
typ => format!("{}: {}", name, typ),
DocParam::Args { name, typ, .. } => match typ {
t if t.is_any() => format!("*{}", name),
typ => format!("*{}: {}", name, typ),
},
DocParam::Kwargs { name, typ, .. } => match typ {
t if t.is_any() => format!("**{}", name),
typ => format!("**{}: {}", name, typ),
},
}
}
Expand Down

0 comments on commit eb11575

Please sign in to comment.