1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vdoc: show map type correctly

This commit is contained in:
yuyi 2020-03-11 12:18:20 +08:00 committed by GitHub
parent b9955aee84
commit 9e14850bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -433,7 +433,14 @@ pub fn (table &Table) type_to_str(t Type) string {
res += ')'
return res
}
mut res := sym.name.replace('array_', '[]')
mut res := sym.name
if sym.kind == .array {
res = res.replace('array_', '[]')
}
else if sym.kind == .map {
res = res.replace('map_string_', 'map[string]')
}
// mod.submod.submod2.Type => submod2.Type
if res.contains('.') {
vals := res.split('.')