mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Do not show record type signature if it contains at least one private tag
This commit is contained in:
parent
6050776ff8
commit
09aad833d5
1 changed files with 7 additions and 8 deletions
|
@ -242,24 +242,23 @@ fn type_to_docs(type_annotation: ast::TypeAnnotation) -> Option<TypeAnnotation>
|
||||||
|
|
||||||
let mut any_fields_include_private_tags = false;
|
let mut any_fields_include_private_tags = false;
|
||||||
|
|
||||||
let mut index = 0;
|
for field in fields {
|
||||||
|
|
||||||
while index < fields.len() && !any_fields_include_private_tags {
|
|
||||||
let field = fields[index];
|
|
||||||
|
|
||||||
match record_field_to_doc(field.value) {
|
match record_field_to_doc(field.value) {
|
||||||
None => {
|
None => {
|
||||||
any_fields_include_private_tags = true;
|
any_fields_include_private_tags = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
Some(doc_field) => {
|
Some(doc_field) => {
|
||||||
doc_fields.push(doc_field);
|
doc_fields.push(doc_field);
|
||||||
|
|
||||||
index = index + 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if any_fields_include_private_tags {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
Some(Record { fields: doc_fields })
|
Some(Record { fields: doc_fields })
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ast::TypeAnnotation::SpaceBefore(&sub_type_ann, _) => type_to_docs(sub_type_ann),
|
ast::TypeAnnotation::SpaceBefore(&sub_type_ann, _) => type_to_docs(sub_type_ann),
|
||||||
ast::TypeAnnotation::SpaceAfter(&sub_type_ann, _) => type_to_docs(sub_type_ann),
|
ast::TypeAnnotation::SpaceAfter(&sub_type_ann, _) => type_to_docs(sub_type_ann),
|
||||||
_ => {
|
_ => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue