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

Include inner-overload method in classview

This commit is contained in:
Brian Fiete 2020-12-04 05:22:49 -08:00
parent a17b086bd4
commit 687dde063f
3 changed files with 42 additions and 14 deletions

View file

@ -62,7 +62,8 @@ namespace IDE.ui
case .Field,
.Property:
IDEUtils.ColorizeCodeString(mLabel, .Field);
case .Method:
case .Method,
.MethodOverride:
IDEUtils.ColorizeCodeString(mLabel, .Method);
default:
}
@ -109,7 +110,8 @@ namespace IDE.ui
icon = DarkTheme.sDarkTheme.GetImage(.Field);
case .Property:
icon = DarkTheme.sDarkTheme.GetImage(.Property);
case .Method:
case .Method,
.MethodOverride:
icon = DarkTheme.sDarkTheme.GetImage(.Method);
default:
}
@ -319,7 +321,8 @@ namespace IDE.ui
Field,
Property,
Method
Method,
MethodOverride,
}
class PendingInfo
@ -764,6 +767,7 @@ namespace IDE.ui
case 'F': kind = .Field;
case 'P': kind = .Property;
case 'M': kind = .Method;
case 'o': kind = .MethodOverride;
}
var itr = param.Split('\t');
let entry = mPendingInfo.mPendingRoot.AddChild(kind, scope String()..Reference(itr.GetNext().Get()));

View file

@ -8237,11 +8237,14 @@ String BfCompiler::GetTypeDefMatches(const StringImpl& searchStr)
if (methodDef->mMethodDeclaration == NULL)
continue;
matchHelper.ClearResults();
if (matchHelper.CheckMemberMatch(typeDef, methodDef->mName))
{
result += "M";
if (methodDef->mIsOverride)
result += "o";
else
result += "M";
if (BfTypeUtils::TypeToString(result, typeDef, (BfTypeNameFlags)(BfTypeNameFlag_HideGlobalName | BfTypeNameFlag_InternalName)))
result += ".";
matchHelper.AddMethodDef(methodDef);

View file

@ -20669,15 +20669,15 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
genericParam->mExternType = ResolveTypeRef(externConstraintDef->mTypeRef);
auto autoComplete = mCompiler->GetAutoComplete();
if (autoComplete != NULL)
autoComplete->CheckTypeRef(externConstraintDef->mTypeRef, false);
if (autoComplete != NULL)
autoComplete->CheckTypeRef(externConstraintDef->mTypeRef, false);
if (genericParam->mExternType != NULL)
{
//
}
else
genericParam->mExternType = GetPrimitiveType(BfTypeCode_Var);
if (genericParam->mExternType != NULL)
{
//
}
else
genericParam->mExternType = GetPrimitiveType(BfTypeCode_Var);
}
ResolveGenericParamConstraints(genericParam, methodInstance->mIsUnspecialized);
@ -20724,6 +20724,8 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
if (methodDef->mIsOverride)
{
bool found = false;
for (int virtIdx = 0; virtIdx < (int)typeInstance->mVirtualMethodTable.size(); virtIdx++)
{
auto& ventry = typeInstance->mVirtualMethodTable[virtIdx];
@ -20742,6 +20744,7 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
auto baseType = typeInstance->mBaseType;
if (baseType != NULL)
{
found = true;
while ((baseType->mBaseType != NULL) && (virtIdx < baseType->mBaseType->mVirtualMethodTableSize))
baseType = baseType->mBaseType;
BfMethodInstance* baseVirtMethod = baseType->mVirtualMethodTable[virtIdx].mImplementingMethod;
@ -20755,7 +20758,25 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
}
}
}
}
if ((!found) && (autoComplete->mIsGetDefinition) && (methodDef->mDeclaringType->IsExtension()))
{
for (auto& methodGroup : typeInstance->mMethodInstanceGroups)
{
auto defaultMethod = methodGroup.mDefault;
if (defaultMethod == NULL)
continue;
if (!defaultMethod->mMethodDef->mIsExtern)
continue;
if (!CompareMethodSignatures(defaultMethod, methodInstance))
continue;
autoComplete->SetDefinitionLocation(defaultMethod->mMethodDef->GetRefNode(), true);
autoComplete->mDefType = typeInstance->mTypeDef;
autoComplete->mDefMethod = defaultMethod->mMethodDef;
}
}
}
}
}