mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +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,
|
||||
PanelHeader,
|
||||
|
||||
ExtMethod,
|
||||
|
||||
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":
|
||||
entryIcon = DarkTheme.sDarkTheme.GetImage(.Method);
|
||||
case "extmethod":
|
||||
entryIcon = DarkTheme.sDarkTheme.GetImage(.ExtMethod);
|
||||
case "field":
|
||||
entryIcon = DarkTheme.sDarkTheme.GetImage(.Field);
|
||||
case "property":
|
||||
|
|
|
@ -467,6 +467,9 @@ void BfAutoComplete::AddMethod(BfTypeInstance* typeInstance, BfMethodDef* method
|
|||
entry.mEntryType = "mixin";
|
||||
}
|
||||
}
|
||||
if (methodDef->mMethodType == BfMethodType_Extension)
|
||||
entry.mEntryType = "extmethod";
|
||||
|
||||
if (auto entryAdded = AddEntry(entry, filter))
|
||||
{
|
||||
if (methodDecl != NULL)
|
||||
|
@ -1112,6 +1115,7 @@ void BfAutoComplete::AddExtensionMethods(BfTypeInstance* targetType, BfTypeInsta
|
|||
|
||||
if (!genericInferContext.InferGenericArgument(methodInstance, targetType, thisType, BfIRValue()))
|
||||
continue;
|
||||
genericInferContext.InferGenericArguments(methodInstance);
|
||||
|
||||
thisType = mModule->ResolveGenericType(thisType, NULL, &genericTypeVector, false);
|
||||
if (thisType == NULL)
|
||||
|
@ -1419,7 +1423,8 @@ void BfAutoComplete::CheckIdentifier(BfAstNode* identifierNode, bool isInExpress
|
|||
mModule->PopulateGlobalContainersList(globalLookup);
|
||||
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);
|
||||
|
||||
if (!isStatic)
|
||||
{
|
||||
{
|
||||
auto checkTypeInst = mModule->mCurTypeInstance;
|
||||
while (checkTypeInst != NULL)
|
||||
{
|
||||
AddExtensionMethods(typeInst, checkTypeInst, filter, allowProtected, allowPrivate);
|
||||
AddExtensionMethods(typeInst, checkTypeInst, filter, true, true);
|
||||
checkTypeInst = mModule->GetOuterType(checkTypeInst);
|
||||
}
|
||||
|
||||
|
@ -1781,8 +1786,9 @@ bool BfAutoComplete::CheckMemberReference(BfAstNode* target, BfAstNode* dotToken
|
|||
BfGlobalLookup globalLookup;
|
||||
globalLookup.mKind = BfGlobalLookup::Kind_All;
|
||||
mModule->PopulateGlobalContainersList(globalLookup);
|
||||
for (auto& globalContainer : mModule->mContext->mCurTypeState->mGlobalContainers)
|
||||
AddExtensionMethods(typeInst, globalContainer.mTypeInst, filter, false, false);
|
||||
for (auto& globalContainer : mModule->mContext->mCurTypeState->mGlobalContainers)
|
||||
if (globalContainer.mTypeInst != NULL)
|
||||
AddExtensionMethods(typeInst, globalContainer.mTypeInst, filter, false, false);
|
||||
}
|
||||
|
||||
BfStaticSearch* staticSearch = mModule->GetStaticSearch();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue