Problem with intellisense

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by John Youren
Avatar
Hi,

My code

        private void code_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Space)
            {
                IntelliPromptMemberList memberList = code.IntelliPrompt.MemberList;
                memberList.Clear();

                memberList.AllowedCharacters.Add(new CharInterval(' '));

                foreach (LexicalPatternGroup lp in code.Document.Language.LexicalStates[0].LexicalPatternGroups)
                {
                    if ("ReservedWordToken" == lp.TokenKey)
                    {
                        foreach (LexicalPattern p in lp)
                        {
                            IntelliPromptMemberListItem mi = new IntelliPromptMemberListItem();
                            mi.Text = p.Pattern.Replace("\\s+", " ");
                            if (code.Document.Language.Properties[mi.Text] != null)
                                mi.Description = code.Document.Language.Properties[mi.Text].Value;
                            memberList.Add(mi);
                        }
                    }
                }
                memberList.Sorted = true;
                memberList.Show();
            }
        }
causes the following error, and causes my program to quit.

A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
at System.Globalization.CompareInfo.Compare(String string1, Int32 offset1, Int32 length1, String string2, Int32 offset2, Int32 length2, CompareOptions options)
   at System.String.Compare(String strA, Int32 indexA, String strB, Int32 indexB, Int32 length, Boolean ignoreCase)
   at _13._1(Boolean , Int32 , String )
   at ActiproSoftware.SyntaxEditor.IntelliPromptMemberList.ActiproSoftware.SyntaxEditor.ISyntaxEditorEditModeHandler.OnSelectionChanged(SelectionEventArgs e)
   at ActiproSoftware.SyntaxEditor.SyntaxEditor._1(SelectionEventArgs )
   at ActiproSoftware.SyntaxEditor.EditorView._1(Object , SelectionEventArgs )
   at ActiproSoftware.SyntaxEditor.Selection._1(SelectionEventArgs )
   at ActiproSoftware.SyntaxEditor.Selection._1(Boolean )
   at ActiproSoftware.SyntaxEditor.Selection._1(DocumentModificationEventArgs )
   at ActiproSoftware.SyntaxEditor.SyntaxEditor._2(Object , DocumentModificationEventArgs )
   at ActiproSoftware.SyntaxEditor.Document._1(DocumentModificationEventArgs )
   at ActiproSoftware.SyntaxEditor.Document._2(DocumentModificationEventArgs )
   at ActiproSoftware.SyntaxEditor.Document._1(DocumentModification )
   at ActiproSoftware.SyntaxEditor.Document._1(DocumentModificationType , Int32 , Int32 , String , Boolean )
   at ActiproSoftware.SyntaxEditor.Document.UndoableInsert(DocumentModificationType type, Int32 offset, Int32 length, String text)
   at ActiproSoftware.SyntaxEditor.EditorView._1(String )
   at ActiproSoftware.SyntaxEditor.EditorView.InsertText(String text)
   at ActiproSoftware.SyntaxEditor.Commands.TypingCommand.Execute(EditCommandContext context)
   at ActiproSoftware.SyntaxEditor.MacroRecording._1(EditCommand , EditCommandContext )
   at ActiproSoftware.SyntaxEditor.EditorView._1(EditCommand , Boolean )
   at ActiproSoftware.SyntaxEditor.SyntaxEditor._1(EditorView , Keys , Char , Boolean )
   at ActiproSoftware.SyntaxEditor.SyntaxEditor.OnKeyPress(KeyPressEventArgs e)
   at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   at System.Windows.Forms.Control.WmKeyChar(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at ActiproSoftware.SyntaxEditor.SyntaxEditor.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at Synergy_IDE.Splash.Main(String[] args) in C:\Source\Synergy IDE\Splash.cs:line 14
Any suggestions, thanks!

Comments (1)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Do you have the latest maintenance release? Also, each item needs
its pre-text set to some non-null value. Generally it's set to the same
as the Text property. So make sure you do that.

The constructor for IntelliPromptMemberListItem normally handles this.
I'm not sure how you are accessing a parameterless constructor for
IntelliPromptMemberListItem since a parameterless one isn't defined.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.