Skip to content

Commit

Permalink
v search: add an import suggestion for an already existing module in …
Browse files Browse the repository at this point in the history
…vlib
  • Loading branch information
spytheman committed Nov 7, 2020
1 parent 6354fa0 commit 56817ea
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/tools/vpm.v
Expand Up @@ -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.')
}
Expand Down

0 comments on commit 56817ea

Please sign in to comment.