mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03: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 {
|
||||
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 {
|
||||
println('\nUse "v install author_name.module_name" to install the module.')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user