vdoc: improve error message for non-existing symbols (#9359)
parent
7bbcf02134
commit
eccf707270
|
@ -330,7 +330,8 @@ fn (mut vd VDoc) generate_docs_from_file() {
|
||||||
}
|
}
|
||||||
outputs := vd.render(out)
|
outputs := vd.render(out)
|
||||||
if outputs.len == 0 {
|
if outputs.len == 0 {
|
||||||
println('No documentation for $dirs')
|
eprintln('vdoc: No documentation found for ${dirs[0]}')
|
||||||
|
exit(1)
|
||||||
} else {
|
} else {
|
||||||
first := outputs.keys()[0]
|
first := outputs.keys()[0]
|
||||||
println(outputs[first])
|
println(outputs[first])
|
||||||
|
|
|
@ -231,10 +231,6 @@ pub fn (mut d Doc) stmt(stmt ast.Stmt, filename string) ?DocNode {
|
||||||
return error('invalid stmt type to document')
|
return error('invalid stmt type to document')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
included := node.name in d.filter_symbol_names || node.parent_name in d.filter_symbol_names
|
|
||||||
if d.filter_symbol_names.len != 0 && !included {
|
|
||||||
return error('not included in the list of symbol names')
|
|
||||||
}
|
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,6 +424,13 @@ pub fn (mut d Doc) file_asts(file_asts []ast.File) ? {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if d.filter_symbol_names.len != 0 && d.contents.len != 0 {
|
||||||
|
for filter_name in d.filter_symbol_names {
|
||||||
|
if filter_name !in d.contents {
|
||||||
|
return error('vdoc: `$filter_name` symbol in module `$d.orig_mod_name` not found')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
d.time_generated = time.now()
|
d.time_generated = time.now()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue