Bug 11749 - Problems with nested blocks without braces
Summary: Problems with nested blocks without braces
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Windows
: Normal normal
Target Milestone: 4.2.3 (from master)
Assignee: Mike Krüger
Depends on:
Reported: 2013-04-12 02:41 UTC by Lopatkin Ilja
Modified: 2014-01-10 07:18 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Example video (1.91 MB, application/octet-stream)
2013-04-12 02:42 UTC, Lopatkin Ilja

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:

Description Lopatkin Ilja 2013-04-12 02:41:35 UTC
In an attached video file you can see the problems.
First, if I write nested foreach blocks with braces - everything is fine.
But if I omit braces on the top level because the only statement will be the nested foreach block which is the correct C# code, MD mismatches indentation level. And please note how instead of the "in" keyword there was an "int".
Moreover, when I fix the indentation manually and paste code in another place it corrupts my formatting again.
I have "End of line" code formatting policy and only "Insert matching brace", "Smart semicolon placement" options enabled.
Comment 1 Lopatkin Ilja 2013-04-12 02:42:34 UTC
Created attachment 3803 [details]
Example video
Comment 2 Mike Krüger 2013-09-04 07:24:19 UTC
Comment 3 Atin 2014-01-06 06:37:49 UTC
Today, we have checked this issue with

Windows 8
XS 4.2.3(build 23)

If we omit braces on foreach block at top level then  instead of the "in" keyword there was an "int" on second foreach block.This issue is still exists. 

However in XS indentation mismatch doesn't occur if we omit braces.
screencast for the same: http://screencast.com/t/YsS7OXVkv

Hence reopening this issue
Comment 4 Lluis Sanchez 2014-01-09 12:33:18 UTC
This is a different issue. Can you please open a new bug? this one is fixed.
Comment 5 Atin 2014-01-10 07:18:27 UTC
As per comment 4 We have filed Bug 17164 for the same.

However in XS indentation mismatch doesn't occur in XS. Hence marking this as Verified.