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:
RUSShyTwo 2021-12-05 04:56:56 +01:00 committed by GitHub
parent 2bfd3d004f
commit f125978924
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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
|| symbols[0].kind == CompletionKind.className)
{
auto constructor = symbols[0].getPartsByName(CONSTRUCTOR_SYMBOL_NAME);
if (constructor.length == 0)
{
// Build a call tip out of the struct fields
@ -640,6 +646,7 @@ void setCompletions(T)(ref AutocompleteResponse response,
}
}
}
setCallTips:
response.completionType = CompletionType.calltips;
foreach (symbol; symbols)