Bug 4838 - Formatter and indenter are inconsistent
Summary: Formatter and indenter are inconsistent
Status: RESOLVED DUPLICATE of bug 4096
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-05-02 18:00 UTC by Mikayla Hutchinson [MSFT]
Modified: 2012-05-03 00:28 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 DUPLICATE of bug 4096

Description Mikayla Hutchinson [MSFT] 2012-05-02 18:00:34 UTC
In the following code, remove and re-type the closing brace on the line before the "break;". MD de-indents it one level, which is wrong. Now re-type the semicolon after the break statement. The formatter fixes the brace's indentation.

namespace foo
{
	class bar
	{
		string GetOldMcsName (TargetFrameworkMoniker fx)
		{
			//old compilers for specific frameworks
			switch (fx.Identifier) {
			case TargetFrameworkMoniker.ID_NET_FRAMEWORK: {
					switch (fx.Version) {
					case "1.1":
						return "mcs";
					case "2.0":
					case "3.0":
					case "3.5":
						return "gmcs";
					case "4.0":
						return "dmcs";
					}
				}
				break;
			case TargetFrameworkMoniker.ID_MONODROID:
			case TargetFrameworkMoniker.ID_MONOTOUCH:
			case TargetFrameworkMoniker.ID_SILVERLIGHT:
				return "smcs";
			}

			return "mcs";
		}
	}
}
Comment 1 Mike Krüger 2012-05-03 00:28:11 UTC
That's why I want to take it out - but I don't get time for fixing the indenter/code formatter atm.

*** This bug has been marked as a duplicate of bug 4096 ***