0
我目前正在使用Scintilla为Text组件创建一个IDE。但自动完成有一些问题,我不能修复。Scintilla.NET自动完成自动选择第一个元素(C#)
我输入后自动显示提案列表。在对象或类名后。
然后我打电话以下几点:
int pos = _editor.NativeInterface.GetCurrentPos();
string word = _editor.GetWordFromPosition(pos - 1);
if (string.IsNullOrEmpty(word))
return;
if (Objects.Keys.Contains(word))
{
System.Reflection.MemberInfo[] memberInfos = Reflector.PublicMembersOf(Objects[word]);
List<String> proposals = new List<string>();
foreach (System.Reflection.MemberInfo mi in memberInfos)
{
string member = mi.ToString();
if (Reflector.IsRealMethod(mi))
proposals.Add(mi.ToString().Split(" ".ToCharArray(), 2)[1].Replace(" ", ""));
}
proposals.Sort();
_editor.AutoComplete.Show(0, proposals);
}
Objects
是HashMap<String, Type>
所有的对象,并有相应的类型存储。
当我第一次调用自动完成时,它工作正常。但第二次使用它会自动完成proposals
的第一个元素。
对此没有评论?你需要更多的代码吗?我真的需要这个,我没有完成它。 – 2012-02-07 09:11:58