From ed9075b9374de42a7c650187ab35c50f89cf2e38 Mon Sep 17 00:00:00 2001 From: yuyi Date: Fri, 6 Mar 2020 23:28:20 +0800 Subject: [PATCH] v doc: don't show 'pub' at the beginning --- vlib/v/doc/doc.v | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vlib/v/doc/doc.v b/vlib/v/doc/doc.v index 5961765308..4bcdd87043 100644 --- a/vlib/v/doc/doc.v +++ b/vlib/v/doc/doc.v @@ -63,7 +63,7 @@ pub fn doc(mod string, table &table.Table) string { } fn (d &Doc) get_fn_node(f ast.FnDecl) string { - return f.str(d.table).replace(d.mod + '.', '') + return f.str(d.table).replace_each([d.mod + '.', '', 'pub ', '']) } fn (d mut Doc) print_fns() { @@ -92,8 +92,9 @@ fn (d Doc) get_fn_signatures(filter_fn FilterFn) []string { fn_signatures << d.get_fn_node(it) } } - else {} - } + else { + } + } } fn_signatures.sort() return fn_signatures