Bug 5136 - Document Formatting not working properly
Summary: Document Formatting not working properly
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 3.0.x
Hardware: Macintosh Mac OS
: Normal enhancement
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-05-17 07:49 UTC by Neal
Modified: 2013-09-04 06:34 UTC (History)
3 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 NOT_REPRODUCIBLE

Description Neal 2012-05-17 07:49:10 UTC
Hello,

It seems like code (document) formatting is not working properly in the new (stable) MD 3.0.1.  Please review.

I notice things like indentation are not occurring, I tried also setting all C# code formatting to "Visual Studio" where available.

It also would be nice to have some documentation available on all the settings and options in MonoDevelop rather than shooting in the dark trying to figure out this stuff.  And also better examples of these different formatting settings you now have available.

Thank you.
Comment 1 Mike Krüger 2012-05-21 07:20:32 UTC
Y we can need a better source preview.

But what 'documentation' do you expect when you've a format option like: method brace style ?
Comment 2 Matt 2012-05-23 15:17:06 UTC
I came across this problem also. Here are my Help-About stats:

MonoDevelop 3.1.0
Installation UUID: feaee481-7c2a-4781-a090-d6228809132d
Runtime:
	Mono 2.11.1 ((no/426188e Tue May 15 15:50:21 EDT 2012) (64-bit)
	GTK 2.22.0
	GTK# (2.12.0.0)
Build information:
	Git revision: dc87d3242eedc2439f023c9e0b8883acfb3d8faa-dirty
	Build date: 2012-05-16 14:50:52+0000
Operating System:
	Linux
	Linux pharos 2.6.35-32-generic #67-Ubuntu SMP Mon Mar 5 19:39:49 UTC 2012 x86_64 GNU/Linux
Comment 3 Mike Krüger 2012-05-23 16:50:39 UTC
Which issue? 

Be more specific.

Input -> Output + Expected output.
Comment 4 Matt 2012-05-24 06:39:17 UTC
Mike,

Sorry, I was not clear. Code formatting is not working. When I set the "C# Code Format" options and then do "Format Document" or "Format Selection" nothing happens or the code is formatted to options not specified by the options despite the code in question not adhering to the format specified by the options.

So for example, space after function call is unchecked, code like:

int y = f(x);

would get formatted to:

int y = f (x);

or another example, code originally written as:

int w = g (u);

will not change when selected and "Format Selection" is done. 

Matt
Comment 5 Mike Krüger 2012-05-24 16:32:16 UTC
Ok then there is a policy wrong

Check the c# code formatting options on the project level - I think they're set to mono. If the formatting jumps on it's working (we've a bug open about not beeing able to format - that's why I asked).

Note that the formatting options from IDE level may not affect the project.
Comment 6 Matt 2012-05-24 16:47:49 UTC
The formatting options at the project level are "Inherited Policy" which I assume means inherited from the solution. The solution level is where I set the options.

I'm not sure if this is what you are suggesting, but I changed the policy at the project level to custom, selected some code, chose "Format Selection" from the menu, and there was no change to the selected code (though it violated the policy). 

Matt
Comment 7 Mikayla Hutchinson [MSFT] 2012-05-24 18:22:29 UTC
You're correct that "inherited" in the project policy means that it uses the solution policy. TBH I'm tempted to remove project-level policies, they seem to mostly be confusing. But they don't seem to be at fault here.
Comment 8 Mike Krüger 2013-09-04 06:34:18 UTC
Works for me in 4.1 master