This commit is contained in:
Hackerpilot 2016-08-02 01:44:06 -07:00
parent f365f7ad7b
commit 05873e1567
4 changed files with 15 additions and 13 deletions

View File

@ -801,20 +801,12 @@ DSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope,
if (shouldSwapWithType(completionType, symbols[0].kind, 0, tokens.length - 1))
{
if (symbols.length == 0)
if (symbols.length == 0 || symbols[0].type is null || symbols[0].type is symbols[0])
return [];
if (symbols[0].type is null || symbols[0].type is symbols[0])
{
symbols = [];
}
else if (symbols[0].type.kind == CompletionKind.functionName)
{
symbols = [symbols[0].type.type];
}
else
{
symbols = [symbols[0].type];
}
else if (symbols[0].type.kind == CompletionKind.functionName)
symbols = [symbols[0].type.type];
else
symbols = [symbols[0].type];
}
loop: for (size_t i = 1; i < tokens.length; i++)

0
tests/tc039/expected.txt Normal file
View File

4
tests/tc039/file.d Normal file
View File

@ -0,0 +1,4 @@
auto genFirstSet(Rule* r)
{
switch (r.parts[0].)
}

6
tests/tc039/run.sh Executable file
View File

@ -0,0 +1,6 @@
set -e
set -u
../../bin/dcd-client $1 file.d -c48 > actual.txt
diff actual.txt expected.txt