Skip to content

Commit 9828e50

Browse files
committed
Fix autocomplete in unittest blocks
1 parent adc7faf commit 9828e50

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libdparse

src/conversion/first.d

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ final class FirstPass : ASTVisitor
7070
{
7171
// Create a dummy symbol because we don't want unit test symbols leaking
7272
// into the symbol they're declared in.
73-
SemanticSymbol* s = allocateSemanticSymbol("*unittest*",
73+
SemanticSymbol* s = allocateSemanticSymbol(internString("*unittest*"),
7474
CompletionKind.dummy, null, 0);
7575
s.parent = currentSymbol;
76+
currentSymbol.addChild(s);
7677
currentSymbol = s;
7778
u.accept(this);
7879
currentSymbol = s.parent;
@@ -384,9 +385,9 @@ final class FirstPass : ASTVisitor
384385

385386
if (blockStatement.declarationsAndStatements !is null)
386387
{
387-
currentScope = s;
388+
currentScope = s;
388389
visit (blockStatement.declarationsAndStatements);
389-
currentScope = s.parent;
390+
currentScope = s.parent;
390391
}
391392
}
392393

0 commit comments

Comments
 (0)