Member List: exception and missing items

SyntaxEditor .NET Languages Add-on for Windows Forms Forum

Posted 15 years ago by Lisa
Version: 4.0.0281
I am having 2 problems with the member list.

Problem 1:
In the code editor, when I add the "." after a class instance to access its member list, I will sometimes get the following unhandled exception:
System.InvalidOperationException was unhandled
  Message="Collection was modified after the enumerator was instantiated."
       at System.Collections.Specialized.ListDictionary.NodeKeyValueCollection.NodeKeyValueEnumerator.MoveNext()
       at d.w()
       at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetProjectResolver.a(IDomType A_0, String A_1)
       at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetProjectResolver.GetType(IDomType contextType, String[] importedNamespaces, String typeFullName, DomBindingFlags flags)
       at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetProjectResolver.GetType(DotNetContext context, String fullTypeName, DomBindingFlags flags)
       at ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpContext.ResolveForCode(Document document, CompilationUnit compilationUnit, DotNetProjectResolver projectResolver)
       at ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpContext.GetContextBeforeOffset(Document document, Int32 offset, CompilationUnit compilationUnit, DotNetProjectResolver projectResolver, Boolean forParameterInfo)
       at ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpSyntaxLanguage.GetContext(SyntaxEditor syntaxEditor, Int32 offset, Boolean beforeOffset, Boolean forParameterInfo)
       at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetSyntaxLanguage.b(DotNetLanguage A_0, SyntaxEditor A_1, Boolean A_2)
       at ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpSyntaxLanguage.ShowIntelliPromptMemberList(SyntaxEditor syntaxEditor)
       at ActiproSoftware.SyntaxEditor.Addons.CSharp.CSharpSyntaxLanguage.OnSyntaxEditorKeyTyped(SyntaxEditor syntaxEditor, KeyTypedEventArgs e)
       at ActiproSoftware.SyntaxEditor.SyntaxEditor.a(EditorView A_0, Keys A_1, Char A_2, Boolean A_3)
       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)
Problem 2:
I am using a partial class in the code editor. The rest of the partial class is contained in another file which I load initially using the DotNetProjectResolver.SourceProjectContent.LoadForFile() method. When I display the member list after "this." in the code editor, I sometimes ONLY see the members that exist in the external partial class file, and none of the additional members defined in the code editor show up.

Both of these problems seem to occur randomly. I would estimate that they occur 1 out of every 10-20 times the member list is displayed. On my computer they seem to occur when my computer is busy with another task, such as running a virus scan, but another user's computer here will do it consistently anytime. Do you have any ideas about what is going on?


Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA

It's hard to say without being able to debug it. Are you loading these things via another thread? That's the only thing I can think of offhand that would lead to issues like that.

For #1, we should never see an exception unless you are doing some multi-threaded thing. I would think this should be reproducable otherwise.

For #2, perhaps if you have a lot of processing going and are editing a document, it's not parsing the AST fast. So when the IntelliPrompt looks for a context, it doesn't think it's in a member since it's basing things off the current caret offset, which may have been outside of a member in the previous AST (that is likely out of date due to typing).

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.