Fix namespaces being included for generic parameters

This commit is contained in:
Sinai 2021-04-30 23:43:36 +10:00
parent d76bc1f812
commit d6cde68a44

View File

@ -65,7 +65,9 @@ namespace UnityExplorer.UI.Utility
// Namespace
if (includeNamespace && !string.IsNullOrEmpty(type.Namespace))
bool isGeneric = type.IsGenericParameter || (type.HasElementType && type.GetElementType().IsGenericParameter);
if (!isGeneric && includeNamespace && !string.IsNullOrEmpty(type.Namespace))
syntaxBuilder.Append($"<color={NAMESPACE}>{type.Namespace}</color>.");
// Declaring type
@ -113,7 +115,9 @@ namespace UnityExplorer.UI.Utility
{
string ret = HighlightType(type);
if (includeNamespace && !string.IsNullOrEmpty(type.Namespace))
bool isGeneric = type.IsGenericParameter || (type.HasElementType && type.GetElementType().IsGenericParameter);
if (!isGeneric && includeNamespace && !string.IsNullOrEmpty(type.Namespace))
ret = $"<color={NAMESPACE}>{type.Namespace}</color>.{ret}";
if (includeDllName)