Support module constants in docs.

This commit is contained in:
KtorZ
2022-12-16 23:41:46 +01:00
parent ac0d180c5c
commit e1065e892a
2 changed files with 106 additions and 60 deletions

View File

@@ -386,17 +386,9 @@ impl<'comments> Formatter<'comments> {
}
}
pub fn docs_const_expr<'a>(
&mut self,
public: bool,
name: &'a str,
value: &'a TypedConstant,
) -> Document<'a> {
pub fn docs_const_expr<'a>(&mut self, name: &'a str, value: &'a TypedConstant) -> Document<'a> {
let mut printer = tipo::pretty::Printer::new();
pub_(public)
.append("const ")
.append(name)
name.to_doc()
.append(": ")
.append(printer.print(&value.tipo()))
.append(" = ")