/// <summary> /// Builds a MemberList for the given syntaxEditor /// </summary> /// <param name="syntaxEditor"></param> /// <returns></returns> private MemberList BuildMemberList(ActiproSoftware.SyntaxEditor.SyntaxEditor syntaxEditor) { // Get the target text range int caret = syntaxEditor.Caret.Offset; TextRange targetTextRange = TextRange.Deleted; TextStream stream = syntaxEditor.Document.GetTextStream(caret); // Get the compilation unit var cu = syntaxEditor.Document.SemanticParseData as CompilationUnit; if (cu == null) { return(null); } var itemlist = new Hashtable(); stream.GoToPreviousNonWhitespaceToken(); if (stream.Token.IsComment) { return(null); } var node = cu.FindNodeRecursive <LuatAstNodeBase>(stream.Offset); if (null != node) { foreach (AutoCompleteItem item in m_plugin.Database.GetAutoCompleteList(node, caret)) { itemlist[item.Name] = new IntelliPromptMemberListItem(item.Name, (int)item.Icon, item.Description); } targetTextRange = node.GetAutoCompleteTextRange(caret); } if (itemlist.Count == 0) { return(null); } var memberlist = new MemberList { List = new IntelliPromptMemberListItem[itemlist.Count] }; itemlist.Values.CopyTo(memberlist.List, 0); memberlist.TargetTextRange = targetTextRange; return(memberlist); }