From 9828e5062faafe121c6d10446c0ca4bdb90daabc Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Thu, 18 Sep 2014 17:09:26 -0700 Subject: [PATCH] Fix autocomplete in unittest blocks --- libdparse | 2 +- src/conversion/first.d | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libdparse b/libdparse index 50f0e83..27f45e6 160000 --- a/libdparse +++ b/libdparse @@ -1 +1 @@ -Subproject commit 50f0e833ce664ebb46ada342a2e14c1e1eff0c71 +Subproject commit 27f45e6490e7ef0e9a6ef604e51f68a54b10ee2d diff --git a/src/conversion/first.d b/src/conversion/first.d index 8daec21..56f448f 100644 --- a/src/conversion/first.d +++ b/src/conversion/first.d @@ -70,9 +70,10 @@ final class FirstPass : ASTVisitor { // Create a dummy symbol because we don't want unit test symbols leaking // into the symbol they're declared in. - SemanticSymbol* s = allocateSemanticSymbol("*unittest*", + SemanticSymbol* s = allocateSemanticSymbol(internString("*unittest*"), CompletionKind.dummy, null, 0); s.parent = currentSymbol; + currentSymbol.addChild(s); currentSymbol = s; u.accept(this); currentSymbol = s.parent; @@ -384,9 +385,9 @@ final class FirstPass : ASTVisitor if (blockStatement.declarationsAndStatements !is null) { - currentScope = s; + currentScope = s; visit (blockStatement.declarationsAndStatements); - currentScope = s.parent; + currentScope = s.parent; } }