mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-28 10:52:44 +08:00
various improvements to reflection inspector and C# console
This commit is contained in:
@ -16,10 +16,6 @@ namespace UnityExplorer.UI.Modules
|
||||
public CodeEditor m_codeEditor;
|
||||
public ScriptEvaluator m_evaluator;
|
||||
|
||||
public static bool EnableAutocompletes { get; set; } = true;
|
||||
public static bool EnableAutoIndent { get; set; } = true;
|
||||
|
||||
public static List<Suggestion> AutoCompletes = new List<Suggestion>();
|
||||
public static List<string> UsingDirectives;
|
||||
|
||||
public static readonly string[] DefaultUsing = new string[]
|
||||
@ -115,26 +111,6 @@ namespace UnityExplorer.UI.Modules
|
||||
UsingDirectives = new List<string>();
|
||||
}
|
||||
|
||||
internal void OnInputChanged()
|
||||
{
|
||||
if (!EnableAutocompletes)
|
||||
return;
|
||||
|
||||
AutoCompleter.CheckAutocomplete();
|
||||
AutoCompleter.SetSuggestions(AutoCompletes.ToArray());
|
||||
}
|
||||
|
||||
public void UseAutocomplete(string suggestion)
|
||||
{
|
||||
int cursorIndex = m_codeEditor.InputField.caretPosition;
|
||||
string input = m_codeEditor.InputField.text;
|
||||
input = input.Insert(cursorIndex, suggestion);
|
||||
m_codeEditor.InputField.text = input;
|
||||
m_codeEditor.InputField.caretPosition += suggestion.Length;
|
||||
|
||||
AutoCompleter.ClearAutocompletes();
|
||||
}
|
||||
|
||||
private class VoidType
|
||||
{
|
||||
public static readonly VoidType Value = new VoidType();
|
||||
|
@ -150,7 +150,7 @@ namespace UnityExplorer.UI.Modules
|
||||
|
||||
var text = m_resultListTexts[i];
|
||||
|
||||
var name = $"<color={SyntaxColors.Class_Instance}>{ReflectionHelpers.GetActualType(obj).Name}</color>";
|
||||
var name = $"<color={UISyntaxHighlight.Class_Instance}>{ReflectionHelpers.GetActualType(obj).Name}</color>";
|
||||
|
||||
if (m_context != SearchContext.Instance && m_context != SearchContext.StaticClass)
|
||||
{
|
||||
|
Reference in New Issue
Block a user