Fixes #116: autocomplete modules/packages after import keyword directly

This commit is contained in:
Yazan Dabain 2014-05-30 11:27:44 +03:00
parent b516277b0a
commit a0a6f2c517
1 changed files with 2 additions and 2 deletions

View File

@ -667,15 +667,15 @@ void setImportCompletions(T)(T tokens, ref AutocompleteResponse response)
{
response.completionType = CompletionType.identifiers;
auto moduleParts = tokens.filter!(a => a.type == tok!"identifier").map!("a.text").array();
if (moduleParts.length == 0)
return;
string path = buildPath(moduleParts);
foreach (importDirectory; ModuleCache.getImportPaths())
{
string p = buildPath(importDirectory, path);
Log.trace("Checking for ", p);
if (!exists(p))
continue;
foreach (string name; dirEntries(p, SpanMode.shallow))
{
if (isFile(name) && (name.endsWith(".d") || name.endsWith(".di")))