SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Unhandled Exception on messed up if statement indention

Last post 07-16-2009 6:32 PM by DanielGrunwald. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-23-2009 11:21 PM

    Unhandled Exception on messed up if statement indention

    In the last few revisions at least including version 3.1.0.4349 when you can replicate the following bug by creating an If block

    If Conditional then

        'some code

    End If

    Then commenting out the first line and hitting Ctrl + I. Not sure if the block has to be indented or not before hand for this to occur since I indent frequently while coding.

    SharpDevelop Version : 3.1.0.4349
    .NET Version         : 2.0.50727.4016
    OS Version           : Microsoft Windows NT 6.0.6002 Service Pack 2
    Current culture      : English (United States) (en-US)
    Working Set Memory   : 73280kb
    GC Heap Memory       : 17854kb

    Exception thrown:
    System.InvalidOperationException: Stack empty.
       at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
       at System.Collections.Generic.Stack`1.Peek()
       at VBNetBinding.FormattingStrategy.VBFormattingStrategy.ApplyToRange(TextArea textArea, Stack`1 indentation, Int32 begin, Int32 end, Int32 selBegin, Int32 selEnd)
       at VBNetBinding.FormattingStrategy.VBFormattingStrategy.SmartIndentInternal(TextArea textArea, Int32 begin, Int32 end)
       at VBNetBinding.FormattingStrategy.VBFormattingStrategy.IndentLines(TextArea textArea, Int32 begin, Int32 end)
       at ICSharpCode.TextEditor.Actions.IndentSelection.Convert(IDocument document, Int32 startLine, Int32 endLine)
       at ICSharpCode.TextEditor.Actions.AbstractLineFormatAction.Execute(TextArea textArea)
       at ICSharpCode.SharpDevelop.DefaultEditor.Commands.AbstractEditActionMenuCommand.Run()
       at ICSharpCode.Core.WinForms.MenuCommand.OnClick(EventArgs e)
       at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
       at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
       at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
       at System.Windows.Forms.ToolStripMenuItem.ProcessCmdKey(Message& m, Keys keyData)
       at System.Windows.Forms.ToolStripManager.ProcessShortcut(Message& m, Keys shortcut)
       at System.Windows.Forms.ToolStripManager.ProcessCmdKey(Message& m, Keys keyData)
       at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
       at ICSharpCode.SharpDevelop.Gui.DefaultWorkbench.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
       at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
       at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

    ---- Recent log messages:
    17:14:07.921 [parser] DEBUG - Removing part C:\Users\Owner\Projects\VB.Net\New Way RPG 2\New Way RPG 2\MainForm.vb from compound class New_Way_RPG_2.TBBS.MainForm
    17:14:07.922 [parser] DEBUG - Second-to-last part removed (old part count = 2), overwriting compound with last part
    17:14:07.922 [parser] DEBUG - Adding existing class MainForm from MainForm.vb
    17:14:07.922 [parser] DEBUG - Creating compound for New_Way_RPG_2.TBBS.MainForm
    17:14:08.293 [1] INFO - Run command ICSharpCode.SharpDevelop.Project.Commands.Build
    17:14:08.295 [1] DEBUG - Save C:\Users\Owner\Projects\VB.Net\New Way RPG 2\New Way RPG 2\MainForm.vb
    17:14:08.311 [1] DEBUG - ActiveContentChanged to ICSharpCode.SharpDevelop.Gui.CompilerMessageView
    17:14:08.316 [1] INFO - Start building New Way RPG 2
    17:14:08.316 [1] INFO - Start building TestDriver
    17:14:08.328 [9] INFO - Start job (buildInProcess=False): BuildJob:
      ProjectFileName = C:\Users\Owner\Projects\VB.Net\TestDriver\TestDriver.vbproj
      Target = Build
      13 Properties:
        StyleCopDir =
        BuildingInsideVisualStudio = true
        PythonBinPath = C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\BackendBindings\PythonBinding
        FxCopDir =
        FSharpBuildTasksPath = C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\BackendBindings\FSharpBinding
        BooBinPath = C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\BackendBindings\BooBinding
        SharpDevelopBinPath = C:\Program Files\SharpDevelop\3.0\bin
        SolutionDir = C:\Users\Owner\Projects\VB.Net\New Way RPG 2\
        SolutionExt = .sln
        SolutionFileName = New Way RPG 2.sln
        SolutionPath = C:\Users\Owner\Projects\VB.Net\New Way RPG 2\New Way RPG 2.sln
        Configuration = Debug
        Platform = AnyCPU
      2 Additional Imports:
        $(SharpDevelopBinPath)/SharpDevelop.CodeAnalysis.targets
        C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\Misc\SourceAnalysis/SharpDevelop.SourceAnalysis.targets
      8 Interesting Task Names:
        booc
        csc
        fsc
        ilasm
        light
        lit
        vbc
        FxCop

    17:14:08.329 [8] INFO - Start job (buildInProcess=False): BuildJob:
      ProjectFileName = C:\Users\Owner\Projects\VB.Net\New Way RPG 2\New Way RPG 2\New Way RPG 2.vbproj
      Target = Build
      13 Properties:
        StyleCopDir =
        BuildingInsideVisualStudio = true
        PythonBinPath = C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\BackendBindings\PythonBinding
        FxCopDir =
        FSharpBuildTasksPath = C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\BackendBindings\FSharpBinding
        BooBinPath = C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\BackendBindings\BooBinding
        SharpDevelopBinPath = C:\Program Files\SharpDevelop\3.0\bin
        SolutionDir = C:\Users\Owner\Projects\VB.Net\New Way RPG 2\
        SolutionExt = .sln
        SolutionFileName = New Way RPG 2.sln
        SolutionPath = C:\Users\Owner\Projects\VB.Net\New Way RPG 2\New Way RPG 2.sln
        Configuration = Debug
        Platform = AnyCPU
      2 Additional Imports:
        $(SharpDevelopBinPath)/SharpDevelop.CodeAnalysis.targets
        C:\Program Files\SharpDevelop\3.0\bin\..\AddIns\AddIns\Misc\SourceAnalysis/SharpDevelop.SourceAnalysis.targets
      8 Interesting Task Names:
        booc
        csc
        fsc
        ilasm
        light
        lit
        vbc
        FxCop

    17:14:08.725 [3] DEBUG - BuildOutOfProcess: Received BuildDoneCallback
    17:14:08.725 [3] INFO - Finished building TestDriver
    17:14:09.070 [3] DEBUG - BuildOutOfProcess: Received BuildDoneCallback
    17:14:09.070 [3] INFO - Finished building New Way RPG 2
    17:14:09.071 [3] INFO - Start building New Way RPG 2
    17:14:09.071 [9] INFO - Finished building New Way RPG 2
    17:14:11.148 [1] INFO - Loading addin Hornung.ResourceToolkit.dll
    17:14:11.194 [1] DEBUG - ActiveContentChanged to [TextEditorDisplayBindingWrapper C:\Users\Owner\Projects\VB.Net\New Way RPG 2\New Way RPG 2\MainForm.vb]
    17:14:28.002 [parser] DEBUG - Removing part C:\Users\Owner\Projects\VB.Net\New Way RPG 2\New Way RPG 2\MainForm.vb from compound class New_Way_RPG_2.TBBS.MainForm
    17:14:28.002 [parser] DEBUG - Second-to-last part removed (old part count = 2), overwriting compound with last part
    17:14:28.003 [parser] DEBUG - Adding existing class MainForm from MainForm.vb
    17:14:28.003 [parser] DEBUG - Creating compound for New_Way_RPG_2.TBBS.MainForm
    17:14:35.153 [1] INFO - Run command ICSharpCode.SharpDevelop.DefaultEditor.Commands.IndentSelection
    17:14:35.276 [1] ERROR - ThreadException caught
    --> Exception:
    System.InvalidOperationException: Stack empty.
       at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
       at System.Collections.Generic.Stack`1.Peek()
       at VBNetBinding.FormattingStrategy.VBFormattingStrategy.ApplyToRange(TextArea textArea, Stack`1 indentation, Int32 begin, Int32 end, Int32 selBegin, Int32 selEnd)
       at VBNetBinding.FormattingStrategy.VBFormattingStrategy.SmartIndentInternal(TextArea textArea, Int32 begin, Int32 end)
       at VBNetBinding.FormattingStrategy.VBFormattingStrategy.IndentLines(TextArea textArea, Int32 begin, Int32 end)
       at ICSharpCode.TextEditor.Actions.IndentSelection.Convert(IDocument document, Int32 startLine, Int32 endLine)
       at ICSharpCode.TextEditor.Actions.AbstractLineFormatAction.Execute(TextArea textArea)
       at ICSharpCode.SharpDevelop.DefaultEditor.Commands.AbstractEditActionMenuCommand.Run()
       at ICSharpCode.Core.WinForms.MenuCommand.OnClick(EventArgs e)
       at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
       at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
       at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
       at System.Windows.Forms.ToolStripMenuItem.ProcessCmdKey(Message& m, Keys keyData)
       at System.Windows.Forms.ToolStripManager.ProcessShortcut(Message& m, Keys shortcut)
       at System.Windows.Forms.ToolStripManager.ProcessCmdKey(Message& m, Keys keyData)
       at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
       at ICSharpCode.SharpDevelop.Gui.DefaultWorkbench.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
       at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
       at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
       at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)

    ---- Post-error application state information:
    Installed 3rd party AddIns:
    Workbench.ActiveContent: [TextEditorDisplayBindingWrapper C:\Users\Owner\Projects\VB.Net\New Way RPG 2\New Way RPG 2\MainForm.vb]
    ProjectService.OpenSolution: [Solution: FileName=C:\Users\Owner\Projects\VB.Net\New Way RPG 2\New Way RPG 2.sln, HasProjects=True, ReadOnly=False]
    ProjectService.CurrentProject: [VBNetProject: New Way RPG 2]

     

     

  • 07-16-2009 6:32 PM In reply to

    Re: Unhandled Exception on messed up if statement indention

    Thanks for the report, added to issue tracker: http://bugtracker.sharpdevelop.net/Default.aspx?p=4&i=1551

Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.