mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 22:27:45 +08:00
Fix namespaces being included for generic parameters
This commit is contained in:
parent
d76bc1f812
commit
d6cde68a44
@ -65,7 +65,9 @@ namespace UnityExplorer.UI.Utility
|
|||||||
|
|
||||||
// Namespace
|
// 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>.");
|
syntaxBuilder.Append($"<color={NAMESPACE}>{type.Namespace}</color>.");
|
||||||
|
|
||||||
// Declaring type
|
// Declaring type
|
||||||
@ -112,8 +114,10 @@ namespace UnityExplorer.UI.Utility
|
|||||||
public static string ParseFullType(Type type, bool includeNamespace = false, bool includeDllName = false)
|
public static string ParseFullType(Type type, bool includeNamespace = false, bool includeDllName = false)
|
||||||
{
|
{
|
||||||
string ret = HighlightType(type);
|
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}";
|
ret = $"<color={NAMESPACE}>{type.Namespace}</color>.{ret}";
|
||||||
|
|
||||||
if (includeDllName)
|
if (includeDllName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user