Bug 405078 - Incorrectly indented switch/case when inside if(), while(), ...
Summary: Incorrectly indented switch/case when inside if(), while(), ...
Status: RESOLVED DUPLICATE of bug 325187
Alias: None
Product: MonoDevelop
Classification: Mono
Component: C# Binding (show other bugs)
Version: SVN
Hardware: All All
: P5 - None : Minor
Target Milestone: ---
Assignee: Mike Krueger
QA Contact: MD Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-30 14:55 UTC by Jan Oravec
Modified: 2010-02-23 12:23 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Oravec 2008-06-30 14:55:06 UTC
I am using 'Indent case labels' and 'Place goto labels one indent less than current' options.

The following code indents wrongly:

if (true)
	switch ("foo")
{
	case "foo":
	Console.WriteLine ();
}

I would expect case body to be indented to the right, as it is when if() is removed.
Comment 1 Jeff Stedfast 2008-06-30 15:03:20 UTC
as a temporary workaround, just add braces to the if-statement as well:

if (true)
{
   ...
}

that should make the smart indenter work again (it gets confused with some situations)
Comment 2 Lluis Sanchez 2010-02-22 17:52:36 UTC
Mike, can you take care of this?
Comment 3 Mike Krueger 2010-02-23 12:23:19 UTC
I'll mark it as a dupe. I wanted to throw old the old smart indenter & replace with the new one. Unfortunately it's not ready yet (need the new parser infrastructure with exact token positions).

In the mean time we've some issues with this - basically for indenting constructs we need an indenter based on a full c# parser - all other 'tricks' for indenting c# code won't be successful.

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