1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Added Interface colorization type

This commit is contained in:
Brian Fiete 2020-08-13 07:00:49 -07:00
parent 9bbcb8eb5e
commit 7a65003679
5 changed files with 13 additions and 5 deletions

View file

@ -280,6 +280,7 @@ namespace IDE
public Color mMethod = 0XFFA6E22A; public Color mMethod = 0XFFA6E22A;
public Color mType = 0XFF66D9EF; public Color mType = 0XFF66D9EF;
public Color mRefType = 0XFF66D9EF; public Color mRefType = 0XFF66D9EF;
public Color mInterface = 0XFF66D9EF;
public Color mNamespace = 0xFF7BEEB7; public Color mNamespace = 0xFF7BEEB7;
public Color mDisassemblyText = 0xFFB0B0B0; public Color mDisassemblyText = 0xFFB0B0B0;
public Color mDisassemblyFileName = 0XFFFF0000; public Color mDisassemblyFileName = 0XFFFF0000;
@ -316,8 +317,11 @@ namespace IDE
GetColor("Type", ref mType); GetColor("Type", ref mType);
if (!sd.Contains("RefType")) if (!sd.Contains("RefType"))
mRefType = mType; mRefType = mType;
if (!sd.Contains("Interface"))
mInterface = mType;
} }
GetColor("RefType", ref mRefType); GetColor("RefType", ref mRefType);
GetColor("Interface", ref mInterface);
GetColor("Namespace", ref mNamespace); GetColor("Namespace", ref mNamespace);
GetColor("DisassemblyText", ref mDisassemblyText); GetColor("DisassemblyText", ref mDisassemblyText);
GetColor("DisassemblyFileName", ref mDisassemblyFileName); GetColor("DisassemblyFileName", ref mDisassemblyFileName);
@ -337,6 +341,7 @@ namespace IDE
SourceEditWidgetContent.sTextColors[(.)SourceElementType.Method] = mMethod; SourceEditWidgetContent.sTextColors[(.)SourceElementType.Method] = mMethod;
SourceEditWidgetContent.sTextColors[(.)SourceElementType.Type] = mType; SourceEditWidgetContent.sTextColors[(.)SourceElementType.Type] = mType;
SourceEditWidgetContent.sTextColors[(.)SourceElementType.RefType] = mRefType; SourceEditWidgetContent.sTextColors[(.)SourceElementType.RefType] = mRefType;
SourceEditWidgetContent.sTextColors[(.)SourceElementType.Interface] = mInterface;
SourceEditWidgetContent.sTextColors[(.)SourceElementType.Namespace] = mNamespace; SourceEditWidgetContent.sTextColors[(.)SourceElementType.Namespace] = mNamespace;
SourceEditWidgetContent.sTextColors[(.)SourceElementType.Disassembly_Text] = mDisassemblyText; SourceEditWidgetContent.sTextColors[(.)SourceElementType.Disassembly_Text] = mDisassemblyText;
SourceEditWidgetContent.sTextColors[(.)SourceElementType.Disassembly_FileName] = mDisassemblyFileName; SourceEditWidgetContent.sTextColors[(.)SourceElementType.Disassembly_FileName] = mDisassemblyFileName;

View file

@ -203,6 +203,7 @@ namespace IDE.ui
0xFFA6E22A, // Method 0xFFA6E22A, // Method
0xFF66D9EF, // Type 0xFF66D9EF, // Type
0xFF66D9EF, // RefType 0xFF66D9EF, // RefType
0xFF66D9EF, // Interface
0xFF7BEEB7, // Namespace 0xFF7BEEB7, // Namespace
0xFFB0B0B0, // Disassembly_Text 0xFFB0B0B0, // Disassembly_Text

View file

@ -31,6 +31,7 @@ namespace IDE.ui
Method, Method,
Type, Type,
RefType, RefType,
Interface,
Namespace, Namespace,
Disassembly_Text, Disassembly_Text,

View file

@ -6712,8 +6712,8 @@ BfType* BfModule::ResolveTypeResult(BfTypeReference* typeRef, BfType* resolvedTy
while (auto qualifiedTypeRef = BfNodeDynCast<BfQualifiedTypeReference>(checkTypeRef)) while (auto qualifiedTypeRef = BfNodeDynCast<BfQualifiedTypeReference>(checkTypeRef))
{ {
if ((mCompiler->mResolvePassData->mSourceClassifier != NULL) && (resolvedTypeRef->IsObject())) if ((mCompiler->mResolvePassData->mSourceClassifier != NULL) && (resolvedTypeRef->IsObjectOrInterface()))
mCompiler->mResolvePassData->mSourceClassifier->SetElementType(qualifiedTypeRef->mRight, BfSourceElementType_RefType); mCompiler->mResolvePassData->mSourceClassifier->SetElementType(qualifiedTypeRef->mRight, resolvedTypeRef->IsInterface() ? BfSourceElementType_Interface : BfSourceElementType_RefType);
StringView leftString = qualifiedTypeRef->mLeft->ToStringView(); StringView leftString = qualifiedTypeRef->mLeft->ToStringView();
BfSizedAtomComposite leftComposite; BfSizedAtomComposite leftComposite;
@ -6745,16 +6745,16 @@ BfType* BfModule::ResolveTypeResult(BfTypeReference* typeRef, BfType* resolvedTy
auto checkNameNode = namedTypeRef->mNameNode; auto checkNameNode = namedTypeRef->mNameNode;
bool setType = false; bool setType = false;
if ((mCompiler->mResolvePassData->mSourceClassifier != NULL) && (resolvedTypeRef->IsObject())) if ((mCompiler->mResolvePassData->mSourceClassifier != NULL) && (resolvedTypeRef->IsObjectOrInterface()))
{ {
if (auto qualifiedNameNode = BfNodeDynCast<BfQualifiedNameNode>(checkNameNode)) if (auto qualifiedNameNode = BfNodeDynCast<BfQualifiedNameNode>(checkNameNode))
{ {
mCompiler->mResolvePassData->mSourceClassifier->SetElementType(qualifiedNameNode->mRight, BfSourceElementType_RefType); mCompiler->mResolvePassData->mSourceClassifier->SetElementType(qualifiedNameNode->mRight, resolvedTypeRef->IsInterface() ? BfSourceElementType_Interface : BfSourceElementType_RefType);
} }
else else
{ {
setType = true; setType = true;
mCompiler->mResolvePassData->mSourceClassifier->SetElementType(checkNameNode, BfSourceElementType_RefType); mCompiler->mResolvePassData->mSourceClassifier->SetElementType(checkNameNode, resolvedTypeRef->IsInterface() ? BfSourceElementType_Interface : BfSourceElementType_RefType);
} }
} }

View file

@ -17,6 +17,7 @@ enum BfSourceElementType
BfSourceElementType_Method, BfSourceElementType_Method,
BfSourceElementType_Type, BfSourceElementType_Type,
BfSourceElementType_RefType, BfSourceElementType_RefType,
BfSourceElementType_Interface,
BfSourceElementType_Namespace BfSourceElementType_Namespace
}; };