Bug 14324 - System.ArgumentOutOfRangeException while formatting C# code
Summary: System.ArgumentOutOfRangeException while formatting C# code
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Linux
: High normal
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-08-29 09:49 UTC by Konrad Kruczyński
Modified: 2013-08-30 02:20 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 Konrad Kruczyński 2013-08-29 09:49:21 UTC
Can't provide the code, but maybe the stack trace will be helpful


System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: ExtraSpaces >= 0 but was -5
  at ICSharpCode.NRefactory.CSharp.Indent.set_ExtraSpaces (Int32 value) [0x0002b] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/Indent.cs:146 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.Align (ICSharpCode.NRefactory.CSharp.AstNode lPar, ICSharpCode.NRefactory.CSharp.AstNode alignNode, Boolean space) [0x00066] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Statements.cs:446 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitIfElseStatement (ICSharpCode.NRefactory.CSharp.IfElseStatement ifElseStatement) [0x00031] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Statements.cs:259 
  at ICSharpCode.NRefactory.CSharp.IfElseStatement.AcceptVisitor (IAstVisitor visitor) [0x00003] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/Statements/IfElseStatement.cs:73 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.<VisitBlockWithoutFixingBraces>m__1C2 (ICSharpCode.NRefactory.CSharp.AstNode child) [0x00041] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Statements.cs:53 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitChildrenToFormat (ICSharpCode.NRefactory.CSharp.AstNode parent, System.Action`1 callback) [0x00090] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor.cs:101 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitBlockWithoutFixingBraces (ICSharpCode.NRefactory.CSharp.BlockStatement blockStatement, Boolean indent) [0x00023] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Statements.cs:46 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitMethodDeclaration (ICSharpCode.NRefactory.CSharp.MethodDeclaration methodDeclaration) [0x00102] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_TypeMembers.cs:388 
  at ICSharpCode.NRefactory.CSharp.MethodDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00003] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/TypeMembers/MethodDeclaration.cs:80 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor+<VisitTypeDeclaration>c__AnonStorey81.<>m__1C0 (ICSharpCode.NRefactory.CSharp.AstNode child) [0x000fd] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Global.cs:242 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitChildrenToFormat (ICSharpCode.NRefactory.CSharp.AstNode parent, System.Action`1 callback) [0x00090] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor.cs:101 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitTypeDeclaration (ICSharpCode.NRefactory.CSharp.TypeDeclaration typeDeclaration) [0x00183] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Global.cs:218 
  at ICSharpCode.NRefactory.CSharp.TypeDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00003] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/TypeDeclaration.cs:123 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor+<VisitNamespaceDeclaration>c__AnonStorey80.<>m__1BF (ICSharpCode.NRefactory.CSharp.AstNode child) [0x00144] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Global.cs:149 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitChildrenToFormat (ICSharpCode.NRefactory.CSharp.AstNode parent, System.Action`1 callback) [0x00090] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor.cs:101 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitNamespaceDeclaration (ICSharpCode.NRefactory.CSharp.NamespaceDeclaration namespaceDeclaration) [0x0006e] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Global.cs:121 
  at ICSharpCode.NRefactory.CSharp.NamespaceDeclaration.AcceptVisitor (IAstVisitor visitor) [0x00003] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/GeneralScope/NamespaceDeclaration.cs:139 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor+<VisitSyntaxTree>c__AnonStorey7F.<>m__1BD (ICSharpCode.NRefactory.CSharp.AstNode child) [0x00065] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Global.cs:70 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitChildrenToFormat (ICSharpCode.NRefactory.CSharp.AstNode parent, System.Action`1 callback) [0x00090] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor.cs:101 
  at ICSharpCode.NRefactory.CSharp.FormattingVisitor.VisitSyntaxTree (ICSharpCode.NRefactory.CSharp.SyntaxTree unit) [0x00023] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Global.cs:63 
  at ICSharpCode.NRefactory.CSharp.SyntaxTree.AcceptVisitor (IAstVisitor visitor) [0x00003] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Ast/SyntaxTree.cs:140 
  at ICSharpCode.NRefactory.CSharp.CSharpFormatter.AnalyzeFormatting (IDocument document, ICSharpCode.NRefactory.CSharp.SyntaxTree syntaxTree, CancellationToken token) [0x00036] in /home/konrad/gits/monodevelop/main/external/nrefactory/ICSharpCode.NRefactory.CSharp/Formatter/CSharpFormatter.cs:140 
  at MonoDevelop.CSharp.Formatting.OnTheFlyFormatter.GetFormattingChanges (MonoDevelop.Projects.Policies.PolicyContainer policyParent, IEnumerable`1 mimeTypeChain, MonoDevelop.Ide.Gui.Document document, System.String input, DomRegion formattingRegion, System.Int32& formatStartOffset, System.Int32& formatLength, Boolean formatLastStatementOnly) [0x000eb] in /home/konrad/gits/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs:166 
  at MonoDevelop.CSharp.Formatting.OnTheFlyFormatter.Format (MonoDevelop.Projects.Policies.PolicyContainer policyParent, IEnumerable`1 mimeTypeChain, MonoDevelop.Ide.Gui.Document data, Int32 startOffset, Int32 endOffset, Boolean exact, Boolean formatLastStatementOnly) [0x00226] in /home/konrad/gits/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs:237 
  at MonoDevelop.CSharp.Formatting.OnTheFlyFormatter.Format (MonoDevelop.Ide.Gui.Document data, Int32 startOffset, Int32 endOffset, Boolean exact) [0x00034] in /home/konrad/gits/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs:65 
  at MonoDevelop.CSharp.Formatting.CSharpFormatter.OnTheFlyFormat (MonoDevelop.Ide.Gui.Document doc, Int32 startOffset, Int32 endOffset) [0x00005] in /home/konrad/gits/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpFormatter.cs:79 
  at MonoDevelop.Ide.CodeFormatting.CodeFormatter.OnTheFlyFormat (MonoDevelop.Ide.Gui.Document doc, Int32 startOffset, Int32 endOffset) [0x0002d] in /home/konrad/gits/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormatter.cs:90 
  at MonoDevelop.Ide.CodeFormatting.FormatBufferHandler.Run (System.Object tool) [0x00061] in /home/konrad/gits/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeFormatting/CodeFormattingCommands.cs:64 
  at MonoDevelop.Components.Commands.CommandHandler.InternalRun (System.Object dataItem) [0x00003] in /home/konrad/gits/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs:42 
  at MonoDevelop.Components.Commands.CommandManager.DefaultDispatchCommand (MonoDevelop.Components.Commands.ActionCommand cmd, MonoDevelop.Components.Commands.CommandInfo info, System.Object dataItem, System.Object target, CommandSource source) [0x00085] in /home/konrad/gits/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1109 
  at MonoDevelop.Components.Commands.CommandManager.DispatchCommand (System.Object commandId, System.Object dataItem, System.Object initialTarget, CommandSource source) [0x002fc] in /home/konrad/gits/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1076
Comment 1 Mike Krüger 2013-08-30 02:20:16 UTC
The stack trace was enough :)

fixed