1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Show invocation param info in mouseover

This commit is contained in:
Brian Fiete 2022-02-12 12:43:10 -05:00
parent b784101e93
commit cd3318cc3e
3 changed files with 68 additions and 9 deletions

View file

@ -7391,6 +7391,48 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
failed = true;
}
if ((arg != NULL) && (autoComplete != NULL) && (autoComplete->mResolveType == BfResolveType_GetResultString) && (autoComplete->IsAutocompleteNode(arg)))
{
if (!autoComplete->mResultString.Contains('\r'))
{
String str;
str += methodInstance->GetParamName(paramIdx);
str += " @ ";
bool isCtor = methodInstance->mMethodDef->mMethodType == BfMethodType_Ctor;
if (isCtor)
str += methodInstance->GetOwner()->mTypeDef->mName->ToString();
else
str += methodInstance->mMethodDef->mName;
str += "(";
for (int i = isCtor ? 1 : 0; i < methodInstance->GetParamCount(); i++)
{
if (i > (isCtor ? 1 : 0))
str += ",";
if (i == paramIdx)
{
if (methodInstance->GetParamKind(paramIdx) == BfParamKind_Params)
str += "params ";
str += mModule->TypeToString(methodInstance->GetParamType(paramIdx));
}
}
str += ")";
if (!autoComplete->mResultString.StartsWith(":"))
autoComplete->mResultString.Clear();
int crPos = (int)autoComplete->mResultString.IndexOf('\n');
if (crPos == -1)
crPos = autoComplete->mResultString.mLength;
int insertPos = BF_MAX(1, crPos);
if (autoComplete->mResultString.IsEmpty())
autoComplete->mResultString += ":";
if (insertPos > 1)
str.Insert(0, '\r');
autoComplete->mResultString.Insert(insertPos, str);
}
}
if (argValue)
{
if ((isThis) && (argValue.mType->IsRef()))