Bugzilla – Bug 405078
Incorrectly indented switch/case when inside if(), while(), ...
Last modified: 2010-02-23 12:23:19 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.
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)
Mike, can you take care of this?
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 ***