diff --git a/actypes.d b/actypes.d index 1d053b1..ef15612 100644 --- a/actypes.d +++ b/actypes.d @@ -246,19 +246,18 @@ public: || a.kind == CompletionKind.enumMember || a.kind == CompletionKind.aliasName) && a.resolvedType is null)()) { -// writeln("Resolving type of symbol ", s.name); + //writeln("Resolving type of symbol ", s.name); Type type = s.type; if (type is null) { //writeln("Could not find it due to null type"); continue; } - if (type.type2.builtinType != TokenType.invalid) { - //writeln("It was a built-in type"); // This part is easy. Autocomplete properties of built-in types - s.resolvedType = findSymbolsInScope(getTokenValue(type.type2.builtinType))[0]; + auto foundSymbols = findSymbolsInScope(getTokenValue(type.type2.builtinType)); + s.resolvedType = foundSymbols[0]; } else if (type.type2.symbol !is null) { diff --git a/acvisitor.d b/acvisitor.d index 8165c61..89baff2 100644 --- a/acvisitor.d +++ b/acvisitor.d @@ -457,7 +457,8 @@ class AutocompleteVisitor : ASTVisitor if (b.right == TokenType.invalid) { // Selecive import - importedSymbols.filter!(a => a.name == b.left).copy(scope_.symbols); + foreach (ACSymbol symbol; importedSymbols.filter!(a => a.name == b.left)) + scope_.symbols ~= symbol; } else { diff --git a/autocomplete.d b/autocomplete.d index 5d8cf30..7fc24db 100644 --- a/autocomplete.d +++ b/autocomplete.d @@ -496,9 +496,11 @@ T getExpression(T)(T beforeTokens) void setImportCompletions(T)(T tokens, ref AutocompleteResponse response) { - writeln("Setting import collections"); response.completionType = CompletionType.identifiers; - string path = buildPath(tokens.filter!(a => a.type == TokenType.identifier).map!("a.value").array()); + auto moduleParts = tokens.filter!(a => a.type == TokenType.identifier).map!("a.value").array(); + if (moduleParts.length == 0) + return; + string path = buildPath(moduleParts); foreach (importDirectory; ModuleCache.getImportPaths()) { string p = format("%s%s%s", importDirectory, dirSeparator, path); diff --git a/editors/textadept/modules/dmd/dcd.lua b/editors/textadept/modules/dmd/dcd.lua index c90e2b2..1081b64 100644 --- a/editors/textadept/modules/dmd/dcd.lua +++ b/editors/textadept/modules/dmd/dcd.lua @@ -123,7 +123,6 @@ function M.autocomplete(ch) p:close() local tmpFile = io.open(fileName, "r") local r = tmpFile:read("*a") - print(r) if r ~= "\n" then if r:match("^identifiers.*") then showCompletionList(r) diff --git a/modulecache.d b/modulecache.d index 46d8585..95c53d0 100644 --- a/modulecache.d +++ b/modulecache.d @@ -51,7 +51,7 @@ struct ModuleCache */ static void clear() { - cache.clear(); + cache = cache.init; } /**