Bug 4918 - Code formatting comments out "else" branches
Summary: Code formatting comments out "else" branches
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: unspecified
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-05-07 05:22 UTC by René Ruppert
Modified: 2012-05-10 09:40 UTC (History)
2 users (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 René Ruppert 2012-05-07 05:22:08 UTC
Monodevelop 2.8.8.4

See the piece of code below as an example. I tend to comment my if and else statements outside of the braces.

// See if the call succeeded.
if ( !oDlTypeRes.Success )
{
  DoIt();
}
// If the user cannot download any flavors
else if ( oDlTypeRes.ResultObject.Length == 0 )
{
  DoSomethingElse();
}

After applying automatic code formatting, the code looks like this: the "else" has been commented out because it was shifted one line up.
I doubt this is intended, no matter what my "new line" options are.

// See if the call succeeded.
if ( !oDlTypeRes.Success )
{
  DoIt();
}
// If the user cannot download any flavors else if ( oDlTypeRes.ResultObject.Length == 0 )
{
  DoSomethingElse();
}
Comment 1 Mike Krüger 2012-05-10 09:40:15 UTC
fixed.