Bug 4845 - Annoying autoformatting of method arguments
Summary: Annoying autoformatting of method arguments
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Mac OS
: Normal enhancement
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-05-02 18:34 UTC by Mikayla Hutchinson [MSFT]
Modified: 2013-09-04 06:43 UTC (History)
1 user (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 Mikayla Hutchinson [MSFT] 2012-05-02 18:34:09 UTC
MonoDevelop autoindenter always uses spaces to align method arguments on subsequent lines if there are any arguments on the first line, and tabs to indent if there aren't. This is inconsistent and annoying. It does:

FooMethod (
    bar,
    baz
);

which I do want, but when I try to do:

FooMethod (bar,
    baz
);

it gets converted to:

FooMethod (bar,
           baz
);

I find this extremely annoying when using MD.
Comment 1 Mike Krüger 2012-05-03 00:33:39 UTC
That's what the auto formatter atm supports.


FooMethod (
    bar,
    baz
);

or

FooMethod (bar,
           baz
);

but not:

FooMethod (bar,
    baz
);

There are too much people that do:

FooMethod (bar,
           baz
);

We could just do an option for this - and replace the indententer with the formatter. (Btw. I think grendel supposed the behaviour we do now - I think it's better as well)
Comment 2 Mikayla Hutchinson [MSFT] 2012-05-03 19:44:34 UTC
Well, I find it extremely annoying for the case where one wants to wrap *some* arguments once the line gets too long. Aligning to the opening '(' does not work well with long method names, and works really badly for nested method calls. It would be better if it indented by one tab for each level of call nesting, e.g.

Foo (bar, Baz (
    blah
  ),
  meh
); 

And requiring wrapping all arguments onto newlines creates a lot of extra newlines.

Personally I would argue for changing the default behavior of the indenter, as this is probably the single most annoying thing in MD for me.

How hard is it to replace the indenter with the formatter?
Comment 4 Mike Krüger 2012-05-04 01:32:57 UTC
btw. the wrapping is no longer part of the on the fly mode.
Comment 6 Mike Krüger 2013-09-04 06:43:57 UTC
The formatter now supports this formatting style.
It's still a todo for the indenter, but I've made a test for it.

During typing it gets corrected by the formatter quite well.