mirror of
https://github.com/vlang/v.git
synced 2025-09-11 08:25:42 -04:00
v search: add an import suggestion for an already existing module in vlib
This commit is contained in:
parent
6354fa031c
commit
56817ea137
@ -142,7 +142,17 @@ fn vpm_search(keywords []string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if index == 0 {
|
if index == 0 {
|
||||||
println('No module(s) found for "$joined"')
|
vexe := os.getenv('VEXE')
|
||||||
|
vroot := os.real_path(os.dir(vexe))
|
||||||
|
mut messages := ['No module(s) found for `$joined` .']
|
||||||
|
for vlibmod in search_keys {
|
||||||
|
if os.is_dir(os.join_path(vroot, 'vlib', vlibmod)) {
|
||||||
|
messages << 'There is already an existing "$vlibmod" module in vlib, so you can just `import $vlibmod` .'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for m in messages {
|
||||||
|
println(m)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
println('\nUse "v install author_name.module_name" to install the module.')
|
println('\nUse "v install author_name.module_name" to install the module.')
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user