mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vdoc: improve error message for non-existing symbols (#9359)
This commit is contained in:
@@ -231,10 +231,6 @@ pub fn (mut d Doc) stmt(stmt ast.Stmt, filename string) ?DocNode {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user