CodeCompletion question

Is there an event fired when the user selects an entry from the listmembers window shown during codecompletion? I have a custom situation where I want to prevent the insertion of the field/member and perform another task based on the entry.

Thanks

Hi Roger,

You can either handle ListMembers.ClosePopup like this:

        public class MyParserWithCodeCompletion : SyntaxParser
        {
            public MyParserWithCodeCompletion()
            {
                Options = SyntaxOptions.CodeCompletion;
            }

            public override void CodeCompletion(string text, StringItemInfo[] textData, Point position, CodeCompletionArgs e)
            {
                CodeCompletionType completionType = GetCompletionType(e, textData, position);
                switch (completionType)
                {
                    case CodeCompletionType.CompleteWord:
                    case CodeCompletionType.ListMembers:
                        var members = new ListMembers();
                        var member = members.CreateListMember();
                        member.Name = "myFunc";
                        members.Add(member);
                        member = members.CreateListMember();
                        member.Name = "myVar";
                        members.Add(member);
                        e.Provider = members;
                        e.NeedShow = true;
                        e.ToolTip = false;
                        members.ClosePopup += Members_ClosePopup;
                        break;
                }
            }

            private void Members_ClosePopup(object sender, ClosingEventArgs e)
            {
                e.Accepted = false;
            }

Kind regards,
Dmitry