Also generate ctor calltips for symbols with a callTip
This is needed because in an upcoming PR i have moved This:aeae249f9f/source/served/commands/complete.d (L969)Into:2bfd3d004f/src/dcd/server/autocomplete/util.d (L756)Since it'll set the callTip for struct/class, this logic must be updated to take that into account
This commit is contained in:
parent
2bfd3d004f
commit
f125978924
|
|
@ -619,10 +619,16 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (symbols[0].kind != CompletionKind.functionName
|
||||||
|
&& (symbols[0].callTip is null))
|
||||||
|
{
|
||||||
if (symbols[0].kind == CompletionKind.structName
|
if (symbols[0].kind == CompletionKind.structName
|
||||||
|| symbols[0].kind == CompletionKind.className)
|
|| symbols[0].kind == CompletionKind.className)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto constructor = symbols[0].getPartsByName(CONSTRUCTOR_SYMBOL_NAME);
|
auto constructor = symbols[0].getPartsByName(CONSTRUCTOR_SYMBOL_NAME);
|
||||||
|
|
||||||
if (constructor.length == 0)
|
if (constructor.length == 0)
|
||||||
{
|
{
|
||||||
// Build a call tip out of the struct fields
|
// Build a call tip out of the struct fields
|
||||||
|
|
@ -640,6 +646,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setCallTips:
|
setCallTips:
|
||||||
response.completionType = CompletionType.calltips;
|
response.completionType = CompletionType.calltips;
|
||||||
foreach (symbol; symbols)
|
foreach (symbol; symbols)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue