diff --git a/src/autocomplete.d b/src/autocomplete.d index 7e519cc..a0d6e06 100644 --- a/src/autocomplete.d +++ b/src/autocomplete.d @@ -397,6 +397,9 @@ AutocompleteResponse parenCompletion(T)(T beforeTokens, return response; } +/** + * Determines if an import is selective, whole-module, or neither. + */ ImportKind determineImportKind(T)(T tokens) { assert (tokens.length > 1); diff --git a/src/conversion/astconverter.d b/src/conversion/astconverter.d index ee5ec8a..b74249d 100644 --- a/src/conversion/astconverter.d +++ b/src/conversion/astconverter.d @@ -118,7 +118,7 @@ class SimpleParser : Parser if (currentIs(tok!"{")) skipBraces(); } - return null; + return allocate!FunctionBody(); } } diff --git a/src/modulecache.d b/src/modulecache.d index d88d5ec..7df5064 100644 --- a/src/modulecache.d +++ b/src/modulecache.d @@ -99,14 +99,18 @@ struct ModuleCache @disable this(); /** - * Adds the given path to the list of directories checked for imports + * Adds the given path to the list of directories checked for imports. + * Performs duplicate checking, so multiple instances of the same path will + * not be present. */ static void addImportPaths(string[] paths) { - foreach (path; paths.filter!(a => existanceCheck(a) && !importPaths[].canFind(a))) - importPaths.insert(path); + import string_interning : internString; + import std.array : array; + auto newPaths = paths.filter!(a => existanceCheck(a) && !importPaths[].canFind(a)).map!(internString).array; + importPaths.insert(newPaths); - foreach (path; importPaths[]) + foreach (path; newPaths[]) { foreach (fileName; dirEntries(path, "*.{d,di}", SpanMode.depth)) {