#66 and partial resolution to constructor completion
This commit is contained in:
parent
55e8577067
commit
ba64604a55
|
|
@ -387,7 +387,7 @@ private:
|
|||
void visitConstructor(size_t location, Parameters parameters,
|
||||
FunctionBody functionBody)
|
||||
{
|
||||
SemanticSymbol* symbol = new SemanticSymbol("this",
|
||||
SemanticSymbol* symbol = new SemanticSymbol("*constructor*",
|
||||
CompletionKind.functionName, symbolFile, location);
|
||||
processParameters(symbol, null, "this", parameters);
|
||||
symbol.protection = protection;
|
||||
|
|
@ -617,7 +617,11 @@ private:
|
|||
currentSymbol.acSymbol.location);
|
||||
break;
|
||||
case aliasName:
|
||||
// TODO
|
||||
const(ACSymbol)* t = resolveType(currentSymbol.type,
|
||||
currentSymbol.acSymbol.location);
|
||||
while (t !is null && t.kind == CompletionKind.aliasName)
|
||||
t = t.type;
|
||||
currentSymbol.acSymbol.type = t;
|
||||
break;
|
||||
case enumName:
|
||||
case keyword:
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
|||
&& symbols[0].callTip is null)
|
||||
{
|
||||
auto call = symbols[0].getPartsByName("opCall");
|
||||
if (call.length == 0)
|
||||
if (call.length > 0)
|
||||
{
|
||||
symbols = call;
|
||||
goto setCallTips;
|
||||
|
|
@ -431,6 +431,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
|||
return;
|
||||
else
|
||||
{
|
||||
Log.trace("Not a function, but it has a constructor");
|
||||
symbols = constructor;
|
||||
goto setCallTips;
|
||||
}
|
||||
|
|
@ -440,6 +441,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
|||
foreach (symbol; symbols)
|
||||
{
|
||||
Log.trace("Adding calltip ", symbol.callTip);
|
||||
if (symbol.kind != CompletionKind.aliasName)
|
||||
response.completions ~= symbol.callTip;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue