diff --git a/autocomplete.d b/autocomplete.d index f3547a0..1df6531 100644 --- a/autocomplete.d +++ b/autocomplete.d @@ -416,6 +416,8 @@ ACSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope, // tokens.map!stringToken); // Find the symbol corresponding to the beginning of the chain ACSymbol*[] symbols; + if (tokens.length == 0) + return []; if (tokens[0] == tok!"." && tokens.length > 1) { tokens = tokens[1 .. $]; diff --git a/conversion/first.d b/conversion/first.d index 052f509..679a7fe 100644 --- a/conversion/first.d +++ b/conversion/first.d @@ -435,6 +435,7 @@ final class FirstPass : ASTVisitor Scope* s = allocate!Scope(semanticAllocator, feStatement.startIndex, bs.endLocation); s.parent = currentScope; currentScope.children.insert(s); + currentScope = s; feExpression = feStatement.low.items[$ - 1]; feStatement.accept(this); feExpression = null;