mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
fix: don't assert well-formed named parameters in docstring (#948)
This commit is contained in:
parent
d5c07b1ae3
commit
a7f203a31c
1 changed files with 7 additions and 3 deletions
|
@ -283,8 +283,12 @@ pub(crate) fn sig_of_type(
|
|||
}
|
||||
|
||||
for (name, ty) in sig_ty.named_params() {
|
||||
let doc = docstring.named.get(name).unwrap();
|
||||
let default = doc.default.clone();
|
||||
let docstring = docstring.named.get(name);
|
||||
let default = Some(
|
||||
docstring
|
||||
.and_then(|doc| doc.default.clone())
|
||||
.unwrap_or_else(|| "unknown".into()),
|
||||
);
|
||||
let ty = ty.clone();
|
||||
|
||||
if matches!(name.as_ref(), "fill" | "stroke" | "size") {
|
||||
|
@ -293,7 +297,7 @@ pub(crate) fn sig_of_type(
|
|||
|
||||
param_specs.push(Interned::new(ParamTy {
|
||||
name: name.clone(),
|
||||
docs: Some(doc.docs.clone()),
|
||||
docs: docstring.map(|doc| doc.docs.clone()),
|
||||
default,
|
||||
ty,
|
||||
attrs: ParamAttrs::named(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue