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:
parent
a17b086bd4
commit
687dde063f
3 changed files with 42 additions and 14 deletions
|
@ -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()));
|
||||
|
|
|
@ -8241,7 +8241,10 @@ String BfCompiler::GetTypeDefMatches(const StringImpl& searchStr)
|
|||
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);
|
||||
|
|
|
@ -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,6 +20758,24 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue