Bug 18538 - Code formatting configuration isn't taken into consideration
Summary: Code formatting configuration isn't taken into consideration
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: unspecified
Hardware: PC Linux
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
Depends on:
Reported: 2014-03-23 00:10 UTC by Atsushi Eno
Modified: 2014-03-25 08:57 UTC (History)
1 user (show)

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:

Description Atsushi Eno 2014-03-23 00:10:57 UTC
Assuming it is TextEditor bug rather than C# addin bug, but could be either.

Steps to reproduce:

- set C# code formatting policy as "Visual Studio"
- open some C# project. I used monodevelop Main.sln.

Change some code to match "Visual Studio" settings e.g.

public int Foo
        return 1;

- Execute "Format document" command on the source.

Actual results:

- code is formatted in the existing settings e.g.

public int Foo {
    get {
        return 1;

Expected results:

- format the source along with the configured settings (in this case "Visual Studio")
Comment 1 Mikayla Hutchinson [MSFT] 2014-03-23 17:09:04 UTC
What version are you using? Where did you set the policy?
Comment 2 Mike Krüger 2014-03-24 10:23:29 UTC
According to your steps it's not a bug - it's a feature.

Try to open the project and set the visual studio formatting inside the project options. The policy from the options are taken for new projects only.
Comment 3 Atsushi Eno 2014-03-25 08:20:15 UTC
I doubt if people would take it as a working feature if it is valid only under such a condition. Here is one typical use case of "format document" feature:

- User opens a project in MD that is written in Visual Studio and conforms to its format.
- User makes changes on the project sources.
- Before sending changes to the original developer, the user wants to have documents in the expected format, so sets document style to "Visual Studio" and runs "Format Document" command.
- It never gets formatted as expected(!)

I think it has to be changed.