parent
be1eb0e983
commit
351bf2ee2d
|
@ -278,6 +278,7 @@ AutocompleteResponse dotCompletion(T)(T beforeTokens,
|
||||||
case tok!")":
|
case tok!")":
|
||||||
case tok!"]":
|
case tok!"]":
|
||||||
case tok!"this":
|
case tok!"this":
|
||||||
|
case tok!"super":
|
||||||
auto allocator = scoped!(CAllocatorImpl!(BlockAllocator!(1024*16)));
|
auto allocator = scoped!(CAllocatorImpl!(BlockAllocator!(1024*16)));
|
||||||
Scope* completionScope = generateAutocompleteTrees(tokenArray, allocator);
|
Scope* completionScope = generateAutocompleteTrees(tokenArray, allocator);
|
||||||
scope(exit) typeid(Scope).destroy(completionScope);
|
scope(exit) typeid(Scope).destroy(completionScope);
|
||||||
|
@ -387,6 +388,8 @@ AutocompleteResponse parenCompletion(T)(T beforeTokens,
|
||||||
case tok!"uintLiteral":
|
case tok!"uintLiteral":
|
||||||
case tok!"ulongLiteral":
|
case tok!"ulongLiteral":
|
||||||
case tok!"wstringLiteral":
|
case tok!"wstringLiteral":
|
||||||
|
case tok!"this":
|
||||||
|
case tok!"super":
|
||||||
case tok!")":
|
case tok!")":
|
||||||
case tok!"]":
|
case tok!"]":
|
||||||
auto allocator = scoped!(CAllocatorImpl!(BlockAllocator!(1024 * 16)))();
|
auto allocator = scoped!(CAllocatorImpl!(BlockAllocator!(1024 * 16)))();
|
||||||
|
@ -685,6 +688,7 @@ ACSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope,
|
||||||
case tok!"ireal":
|
case tok!"ireal":
|
||||||
case tok!"creal":
|
case tok!"creal":
|
||||||
case tok!"this":
|
case tok!"this":
|
||||||
|
case tok!"super":
|
||||||
symbols = symbols[0].getPartsByName(internString(str(tokens[i].type)));
|
symbols = symbols[0].getPartsByName(internString(str(tokens[i].type)));
|
||||||
if (symbols.length == 0)
|
if (symbols.length == 0)
|
||||||
break loop;
|
break loop;
|
||||||
|
@ -952,6 +956,7 @@ private enum TYPE_IDENT_AND_LITERAL_CASES = q{
|
||||||
case tok!"ireal":
|
case tok!"ireal":
|
||||||
case tok!"creal":
|
case tok!"creal":
|
||||||
case tok!"this":
|
case tok!"this":
|
||||||
|
case tok!"super":
|
||||||
case tok!"identifier":
|
case tok!"identifier":
|
||||||
case tok!"stringLiteral":
|
case tok!"stringLiteral":
|
||||||
case tok!"wstringLiteral":
|
case tok!"wstringLiteral":
|
||||||
|
|
|
@ -152,6 +152,7 @@ private:
|
||||||
|
|
||||||
void resolveInheritance(SemanticSymbol* currentSymbol)
|
void resolveInheritance(SemanticSymbol* currentSymbol)
|
||||||
{
|
{
|
||||||
|
import std.algorithm : filter;
|
||||||
outer: foreach (istring[] base; currentSymbol.baseClasses)
|
outer: foreach (istring[] base; currentSymbol.baseClasses)
|
||||||
{
|
{
|
||||||
ACSymbol* baseClass;
|
ACSymbol* baseClass;
|
||||||
|
@ -170,8 +171,16 @@ private:
|
||||||
continue outer;
|
continue outer;
|
||||||
baseClass = symbols[0];
|
baseClass = symbols[0];
|
||||||
}
|
}
|
||||||
currentSymbol.acSymbol.parts.insert(baseClass.parts[]);
|
currentSymbol.acSymbol.parts.insert(baseClass.parts[].filter!(
|
||||||
symbolScope.symbols.insert(baseClass.parts[]);
|
a => a.name.ptr != CONSTRUCTOR_SYMBOL_NAME.ptr));
|
||||||
|
symbolScope.symbols.insert(baseClass.parts[].filter!(
|
||||||
|
a => a.name.ptr != CONSTRUCTOR_SYMBOL_NAME.ptr));
|
||||||
|
if (baseClass.kind == CompletionKind.className)
|
||||||
|
{
|
||||||
|
auto s = allocate!ACSymbol(symbolAllocator,
|
||||||
|
SUPER_SYMBOL_NAME, CompletionKind.variableName, baseClass);
|
||||||
|
symbolScope.symbols.insert(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
calltips
|
||||||
|
this(int x)
|
|
@ -0,0 +1,2 @@
|
||||||
|
calltips
|
||||||
|
this(int x, int y)
|
|
@ -0,0 +1,2 @@
|
||||||
|
calltips
|
||||||
|
this(int x, int y)
|
|
@ -0,0 +1,18 @@
|
||||||
|
class Alpha
|
||||||
|
{
|
||||||
|
this(int x);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Beta : Alpha
|
||||||
|
{
|
||||||
|
this(int x, int y)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
this();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void main(string[] args)
|
||||||
|
{
|
||||||
|
auto b = new Beta();
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
|
||||||
|
dcd-client file.d -c83 > actual1.txt
|
||||||
|
dcd-client file.d -c93 > actual2.txt
|
||||||
|
dcd-client file.d -c148 > actual3.txt
|
||||||
|
diff actual1.txt expected1.txt
|
||||||
|
diff actual2.txt expected2.txt
|
||||||
|
diff actual3.txt expected3.txt
|
Loading…
Reference in New Issue