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

Added mouseover docs support

This commit is contained in:
Brian Fiete 2020-09-25 08:50:39 -07:00
parent dc2603bc60
commit e02b42d6f4
5 changed files with 58 additions and 28 deletions

View file

@ -3850,7 +3850,7 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
autoComplete->mResultString += field->mName;
if (fieldInstance->mConstIdx != -1)
{
{
String constStr = autoComplete->ConstantToString(curCheckType->mConstHolder, BfIRValue(BfIRValueFlags_Const, fieldInstance->mConstIdx));
if (!constStr.IsEmpty())
{
@ -3861,6 +3861,15 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
autoComplete->mResultString += constStr;
}
}
auto fieldDecl = fieldInstance->GetFieldDef()->mFieldDeclaration;
if ((fieldDecl != NULL) && (fieldDecl->mDocumentation != NULL))
{
String docString;
fieldDecl->mDocumentation->GetDocString(docString);
autoComplete->mResultString += "\x03";
autoComplete->mResultString += docString;
}
}
}
@ -7872,6 +7881,13 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
{
autoComplete->mResultString = ":";
autoComplete->mResultString += mModule->MethodToString(moduleMethodInstance.mMethodInstance);
auto methodDecl = moduleMethodInstance.mMethodInstance->mMethodDef->GetMethodDeclaration();
if ((methodDecl != NULL) && (methodDecl->mDocumentation != NULL))
{
autoComplete->mResultString += "\x03";
methodDecl->mDocumentation->GetDocString(autoComplete->mResultString);
}
}
}
}