Bug 4707 - Error in formatting of complex statements
Summary: Error in formatting of complex statements
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-04-28 06:26 UTC by Aleksander Heintz
Modified: 2012-04-28 10:43 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 Aleksander Heintz 2012-04-28 06:26:36 UTC
I use code looking like this:
				new Section ()
				{
					new RootElement ("Alle bygg", rg2) {
						buildings.Select (b => {
                var r = new BuildingElement (b.Value, overview.ContainsKey (b.Key) ? overview[b.Key] : 0);
                r.Tapped += delegate {
                    Util.TrackEvent ("Menu", "SelectBuilding");
                    container.Resolve<FdvService> ().CurrentBuilding = b.Key;
                    container.Resolve<IUIThreadDispatcher> ().DispatchOnUIThread (delegate {
                        container.Resolve<UINavigationController> ().PopToRootViewController (false);
                        container.Resolve<DisplayStack> ().DismissModal (true);
                    });
                };
                return(Element)r;
            }
						)
					}	
				}

And as you can see it's really badly indented by the formatter (I've just done format document). Also, I use the autoformatter, which means that even if I fix the indenting, if I change anything it just goes back to this bad indenting. At one of the lines in the code above, the line is even indented less then the start of the statement.

Anyways, not an important bug to fix, but it'd make MonoDevelop a better product :).
Comment 1 Mike Krüger 2012-04-28 07:43:54 UTC
Which MD version ?
Comment 2 Aleksander Heintz 2012-04-28 08:47:43 UTC
All I believe. It's been this way since I started using MD last summer. Anyways, the current installed version is 2.8.8.4.
Comment 3 Mike Krüger 2012-04-28 10:43:54 UTC
Ok then the good news is that 2.9.x doesn't destroy your code any longer.

The bad news is that there is still much to implement in the formatting engine ...

(But it shouldn't malform code - when the formatting engine fails it just shoudn't interfere with the written code :))