mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Fixed extension methods in autocomplete, added extmethod icon
This commit is contained in:
parent
3f35ef51f2
commit
3560554127
7 changed files with 15 additions and 5 deletions
|
@ -180,6 +180,8 @@ namespace Beefy.theme.dark
|
||||||
ComboBoxFrameless,
|
ComboBoxFrameless,
|
||||||
PanelHeader,
|
PanelHeader,
|
||||||
|
|
||||||
|
ExtMethod,
|
||||||
|
|
||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
BIN
IDE/dist/images/DarkUI.png
vendored
BIN
IDE/dist/images/DarkUI.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
BIN
IDE/dist/images/DarkUI_2.png
vendored
BIN
IDE/dist/images/DarkUI_2.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 50 KiB |
BIN
IDE/dist/images/DarkUI_4.png
vendored
BIN
IDE/dist/images/DarkUI_4.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 89 KiB |
BIN
IDE/dist/images/DarkUI_4.psd
vendored
BIN
IDE/dist/images/DarkUI_4.psd
vendored
Binary file not shown.
|
@ -2015,6 +2015,8 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
case "method":
|
case "method":
|
||||||
entryIcon = DarkTheme.sDarkTheme.GetImage(.Method);
|
entryIcon = DarkTheme.sDarkTheme.GetImage(.Method);
|
||||||
|
case "extmethod":
|
||||||
|
entryIcon = DarkTheme.sDarkTheme.GetImage(.ExtMethod);
|
||||||
case "field":
|
case "field":
|
||||||
entryIcon = DarkTheme.sDarkTheme.GetImage(.Field);
|
entryIcon = DarkTheme.sDarkTheme.GetImage(.Field);
|
||||||
case "property":
|
case "property":
|
||||||
|
|
|
@ -467,6 +467,9 @@ void BfAutoComplete::AddMethod(BfTypeInstance* typeInstance, BfMethodDef* method
|
||||||
entry.mEntryType = "mixin";
|
entry.mEntryType = "mixin";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (methodDef->mMethodType == BfMethodType_Extension)
|
||||||
|
entry.mEntryType = "extmethod";
|
||||||
|
|
||||||
if (auto entryAdded = AddEntry(entry, filter))
|
if (auto entryAdded = AddEntry(entry, filter))
|
||||||
{
|
{
|
||||||
if (methodDecl != NULL)
|
if (methodDecl != NULL)
|
||||||
|
@ -1112,6 +1115,7 @@ void BfAutoComplete::AddExtensionMethods(BfTypeInstance* targetType, BfTypeInsta
|
||||||
|
|
||||||
if (!genericInferContext.InferGenericArgument(methodInstance, targetType, thisType, BfIRValue()))
|
if (!genericInferContext.InferGenericArgument(methodInstance, targetType, thisType, BfIRValue()))
|
||||||
continue;
|
continue;
|
||||||
|
genericInferContext.InferGenericArguments(methodInstance);
|
||||||
|
|
||||||
thisType = mModule->ResolveGenericType(thisType, NULL, &genericTypeVector, false);
|
thisType = mModule->ResolveGenericType(thisType, NULL, &genericTypeVector, false);
|
||||||
if (thisType == NULL)
|
if (thisType == NULL)
|
||||||
|
@ -1419,7 +1423,8 @@ void BfAutoComplete::CheckIdentifier(BfAstNode* identifierNode, bool isInExpress
|
||||||
mModule->PopulateGlobalContainersList(globalLookup);
|
mModule->PopulateGlobalContainersList(globalLookup);
|
||||||
for (auto& globalContainer : mModule->mContext->mCurTypeState->mGlobalContainers)
|
for (auto& globalContainer : mModule->mContext->mCurTypeState->mGlobalContainers)
|
||||||
{
|
{
|
||||||
AddTypeMembers(globalContainer.mTypeInst, true, false, filter, globalContainer.mTypeInst, true, true, false);
|
if (globalContainer.mTypeInst != NULL)
|
||||||
|
AddTypeMembers(globalContainer.mTypeInst, true, false, filter, globalContainer.mTypeInst, true, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1766,11 +1771,11 @@ bool BfAutoComplete::CheckMemberReference(BfAstNode* target, BfAstNode* dotToken
|
||||||
AddTypeMembers(typeInst, isStatic, !isStatic, filter, typeInst, false, false, false);
|
AddTypeMembers(typeInst, isStatic, !isStatic, filter, typeInst, false, false, false);
|
||||||
|
|
||||||
if (!isStatic)
|
if (!isStatic)
|
||||||
{
|
{
|
||||||
auto checkTypeInst = mModule->mCurTypeInstance;
|
auto checkTypeInst = mModule->mCurTypeInstance;
|
||||||
while (checkTypeInst != NULL)
|
while (checkTypeInst != NULL)
|
||||||
{
|
{
|
||||||
AddExtensionMethods(typeInst, checkTypeInst, filter, allowProtected, allowPrivate);
|
AddExtensionMethods(typeInst, checkTypeInst, filter, true, true);
|
||||||
checkTypeInst = mModule->GetOuterType(checkTypeInst);
|
checkTypeInst = mModule->GetOuterType(checkTypeInst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1781,8 +1786,9 @@ bool BfAutoComplete::CheckMemberReference(BfAstNode* target, BfAstNode* dotToken
|
||||||
BfGlobalLookup globalLookup;
|
BfGlobalLookup globalLookup;
|
||||||
globalLookup.mKind = BfGlobalLookup::Kind_All;
|
globalLookup.mKind = BfGlobalLookup::Kind_All;
|
||||||
mModule->PopulateGlobalContainersList(globalLookup);
|
mModule->PopulateGlobalContainersList(globalLookup);
|
||||||
for (auto& globalContainer : mModule->mContext->mCurTypeState->mGlobalContainers)
|
for (auto& globalContainer : mModule->mContext->mCurTypeState->mGlobalContainers)
|
||||||
AddExtensionMethods(typeInst, globalContainer.mTypeInst, filter, false, false);
|
if (globalContainer.mTypeInst != NULL)
|
||||||
|
AddExtensionMethods(typeInst, globalContainer.mTypeInst, filter, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
BfStaticSearch* staticSearch = mModule->GetStaticSearch();
|
BfStaticSearch* staticSearch = mModule->GetStaticSearch();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue