mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 22:07:48 +08:00
Skip private/anonymous types in TypeCompleter results
This commit is contained in:
parent
1a01c740e2
commit
d7ab0a23c6
@ -1,6 +1,7 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using UniverseLib;
|
using UniverseLib;
|
||||||
using UniverseLib.UI;
|
using UniverseLib.UI;
|
||||||
using UniverseLib.UI.Models;
|
using UniverseLib.UI.Models;
|
||||||
@ -67,7 +68,17 @@ namespace UnityExplorer.UI.Widgets.AutoComplete
|
|||||||
{
|
{
|
||||||
allowedTypes = new();
|
allowedTypes = new();
|
||||||
foreach (var entry in ReflectionUtility.AllTypes)
|
foreach (var entry in ReflectionUtility.AllTypes)
|
||||||
allowedTypes.Add(entry.Value);
|
{
|
||||||
|
// skip <PrivateImplementationDetails> and <AnonymousClass> classes
|
||||||
|
var type = entry.Value;
|
||||||
|
if (type.FullName.Contains("PrivateImplementationDetails")
|
||||||
|
|| type.FullName.Contains("DisplayClass")
|
||||||
|
|| type.FullName.Contains('<'))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
allowedTypes.Add(type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user