Bug 4840 - Exception from C# indenter when undoing
Summary: Exception from C# indenter when undoing
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-05-02 18:02 UTC by Mikayla Hutchinson [MSFT]
Modified: 2012-05-03 12:48 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mikayla Hutchinson [MSFT] 2012-05-02 18:02:57 UTC
The following exception was thrown by the C# indenter when doing undo commands.


System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.CSharp.Formatting.IndentVirtualSpaceManager.GetIndentationString (Int32 offset, DocumentLocation loc) [0x0006a] in /Users/michael/Mono/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpIndentVirtualSpaceManager.cs:68 
  at MonoDevelop.CSharp.Formatting.IndentVirtualSpaceManager.GetIndentationString (Int32 lineNumber, Int32 column) [0x00000] in /Users/michael/Mono/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpIndentVirtualSpaceManager.cs:82 
  at MonoDevelop.CSharp.Formatting.IndentVirtualSpaceManager.GetVirtualIndentationColumn (Int32 lineNumber, Int32 column) [0x00000] in /Users/michael/Mono/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpIndentVirtualSpaceManager.cs:108 
  at Mono.TextEditor.TextEditorData.GetVirtualIndentationColumn (DocumentLocation loc) [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:1056 
  at Mono.TextEditor.Caret.UpdateCaretPosition () [0x000c1] in /Users/michael/Mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Caret.cs:372 
  at Mono.TextEditor.TextEditorData.HandleTextReplaced (System.Object sender, Mono.TextEditor.DocumentChangeEventArgs e) [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:178 
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_DocumentChangeEventArgs (object,Mono.TextEditor.DocumentChangeEventArgs)
  at Mono.TextEditor.TextDocument.OnTextReplaced (Mono.TextEditor.DocumentChangeEventArgs args) [0x0000b] in /Users/michael/Mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:393 
  at Mono.TextEditor.TextDocument.Replace (Int32 offset, Int32 count, System.String value) [0x0012e] in /Users/michael/Mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:234 
  at Mono.TextEditor.TextDocument+UndoOperation.Undo (Mono.TextEditor.TextDocument doc) [0x00000] in /Users/michael/Mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:553 
  at Mono.TextEditor.TextDocument.Undo () [0x0003c] in /Users/michael/Mono/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs:800 
  at MonoDevelop.SourceEditor.SourceEditorView.Undo () [0x00016] in /Users/michael/Mono/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs:1123 
  at MonoDevelop.Ide.Gui.ViewCommandHandlers.OnUndo () [0x0000d] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ViewCommandHandlers.cs:115 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000d5] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Reflection/MonoMethod.cs:226 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000eb] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Reflection/MonoMethod.cs:234 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/monobuild/build/BUILD/mono-2.10.9/mcs/class/corlib/System.Reflection/MethodBase.cs:96 
  at MonoDevelop.Components.Commands.CommandHandlerInfo.Run (System.Object cmdTarget, MonoDevelop.Components.Commands.Command cmd) [0x00029] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1908 
  at MonoDevelop.Components.Commands.CommandManager+<DispatchCommand>c__AnonStorey49.<>m__58 () [0x0003d] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1045 
  at MonoDevelop.Components.Commands.CommandManager.DispatchCommand (System.Object commandId, System.Object dataItem, System.Object initialTarget, CommandSource source) [0x0029e] in /Users/michael/Mono/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1062
Comment 1 Mike Krüger 2012-05-03 03:42:20 UTC
I assume the exact case is hard to reproduce ?

I would like to get it - the exception shouldn't occur anymore, but the case would've been interresting to me.
Comment 2 Mikayla Hutchinson [MSFT] 2012-05-03 12:48:02 UTC
Unfortunately it wasn't reproducible, no.