diff --git a/BeefLibs/Beefy2D/src/theme/dark/DarkTheme.bf b/BeefLibs/Beefy2D/src/theme/dark/DarkTheme.bf index 98c5c743..df9ad101 100644 --- a/BeefLibs/Beefy2D/src/theme/dark/DarkTheme.bf +++ b/BeefLibs/Beefy2D/src/theme/dark/DarkTheme.bf @@ -180,6 +180,8 @@ namespace Beefy.theme.dark ComboBoxFrameless, PanelHeader, + ExtMethod, + COUNT }; diff --git a/IDE/dist/images/DarkUI.png b/IDE/dist/images/DarkUI.png index 3decbb68..27ef0572 100644 Binary files a/IDE/dist/images/DarkUI.png and b/IDE/dist/images/DarkUI.png differ diff --git a/IDE/dist/images/DarkUI_2.png b/IDE/dist/images/DarkUI_2.png index 7e969e05..295c6d6e 100644 Binary files a/IDE/dist/images/DarkUI_2.png and b/IDE/dist/images/DarkUI_2.png differ diff --git a/IDE/dist/images/DarkUI_4.png b/IDE/dist/images/DarkUI_4.png index 4fa8ddbb..4bfcf50f 100644 Binary files a/IDE/dist/images/DarkUI_4.png and b/IDE/dist/images/DarkUI_4.png differ diff --git a/IDE/dist/images/DarkUI_4.psd b/IDE/dist/images/DarkUI_4.psd index 5b49f0af..3a5c93f8 100644 Binary files a/IDE/dist/images/DarkUI_4.psd and b/IDE/dist/images/DarkUI_4.psd differ diff --git a/IDE/src/ui/AutoComplete.bf b/IDE/src/ui/AutoComplete.bf index 8876a2e5..f15e4810 100644 --- a/IDE/src/ui/AutoComplete.bf +++ b/IDE/src/ui/AutoComplete.bf @@ -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": diff --git a/IDEHelper/Compiler/BfAutoComplete.cpp b/IDEHelper/Compiler/BfAutoComplete.cpp index 5733da64..313e4bf7 100644 --- a/IDEHelper/Compiler/BfAutoComplete.cpp +++ b/IDEHelper/Compiler/BfAutoComplete.cpp @@ -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();