Improve calltip for functions

This commit is contained in:
ryuukk 2023-02-14 18:50:54 +01:00 committed by GitHub
parent 1c54fc9873
commit f080f39b37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -763,7 +763,16 @@ AutocompleteResponse.Completion makeSymbolCompletionInfo(const DSymbol* symbol,
{
string definition;
if ((kind == CompletionKind.variableName || kind == CompletionKind.memberVariableName) && symbol.type)
{
if (symbol.type.kind == CompletionKind.functionName && symbol.type.type)
{
string retTypeName = symbol.type.type.name;
string fnName = symbol.type.name;
definition = fnName ~ "()->" ~ retTypeName ~ " " ~ symbol.name;
}
else
definition = symbol.type.name ~ ' ' ~ symbol.name;
}
else if (kind == CompletionKind.enumMember)
definition = symbol.name; // TODO: add enum value to definition string
else