1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Added extension methods to navigation bar

This commit is contained in:
Brian Fiete 2021-01-20 13:07:22 -08:00
parent 3560554127
commit 3c8bb9bed9
2 changed files with 7 additions and 2 deletions

View file

@ -17,6 +17,7 @@ namespace IDE.ui
{ {
Unknown, Unknown,
Method, Method,
ExtMethod,
Property, Property,
Class, Class,
Enum, Enum,
@ -111,6 +112,7 @@ namespace IDE.ui
switch(lineData) switch(lineData)
{ {
case "method": entry.mEntryType = .Method; case "method": entry.mEntryType = .Method;
case "extmethod": entry.mEntryType = .ExtMethod;
case "property": entry.mEntryType = .Property; case "property": entry.mEntryType = .Property;
case "class": entry.mEntryType = .Class; case "class": entry.mEntryType = .Class;
case "enum": entry.mEntryType = .Enum; case "enum": entry.mEntryType = .Enum;
@ -151,6 +153,7 @@ namespace IDE.ui
switch (entry.mEntryType) switch (entry.mEntryType)
{ {
case .Method: menuItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Method); case .Method: menuItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Method);
case .ExtMethod: menuItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.ExtMethod);
case .Property: menuItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Property); case .Property: menuItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Property);
case .Class: menuItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Type_Class); case .Class: menuItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Type_Class);
case .Enum: menuItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Type_ValueType); case .Enum: menuItem.mIconImage = DarkTheme.sDarkTheme.GetImage(.Type_ValueType);

View file

@ -3841,7 +3841,7 @@ void BfCompiler::ProcessAutocompleteTempType()
{ {
if (((methodDef->mMethodType == BfMethodType_Normal) || (methodDef->mMethodType == BfMethodType_Operator) || if (((methodDef->mMethodType == BfMethodType_Normal) || (methodDef->mMethodType == BfMethodType_Operator) ||
(methodDef->mMethodType == BfMethodType_Ctor) || (methodDef->mMethodType == BfMethodType_Dtor) || (methodDef->mMethodType == BfMethodType_Ctor) || (methodDef->mMethodType == BfMethodType_Dtor) ||
(methodDef->mMethodType == BfMethodType_Mixin)) && (methodDef->mMethodType == BfMethodType_Mixin) || (methodDef->mMethodType == BfMethodType_Extension)) &&
(methodDef->mMethodDeclaration != NULL)) (methodDef->mMethodDeclaration != NULL))
{ {
methodText = methodDef->ToString(); methodText = methodDef->ToString();
@ -3859,7 +3859,9 @@ void BfCompiler::ProcessAutocompleteTempType()
refNode = methodDeclaration->mNameNode; refNode = methodDeclaration->mNameNode;
module->UpdateSrcPos(refNode, (BfSrcPosFlags)(BfSrcPosFlag_NoSetDebugLoc | BfSrcPosFlag_Force)); module->UpdateSrcPos(refNode, (BfSrcPosFlags)(BfSrcPosFlag_NoSetDebugLoc | BfSrcPosFlag_Force));
methodText += StrFormat("\tmethod\t%d\t%d", module->mCurFilePosition.mCurLine, module->mCurFilePosition.mCurColumn); const char* typeStr = (methodDef->mMethodType == BfMethodType_Extension) ? "extmethod" : "method";
methodText += StrFormat("\t%s\t%d\t%d", typeStr, module->mCurFilePosition.mCurLine, module->mCurFilePosition.mCurColumn);
autoCompleteResultString += methodText; autoCompleteResultString += methodText;
} }