Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Short version: I want vim `set cindent` with the default cinoptions:
In particular, the changes I want from the current default autoindent support is as follows:
(N When in unclosed parentheses, indent N characters from the line
with the unclosed parentheses. Add a 'shiftwidth' for every
unclosed parentheses. When N is 0 or the unclosed parentheses
is the first non-white character in its line, line up with the
next non-white character after the unclosed parentheses.
(default 'shiftwidth' * 2).
Meaning, if I'm writing an `if` block:
and I continue the `if` expression across multiple lines, the expression should be indented by an additional tab stop:
foo (foo &&
Method call arguments, when line wrapping, should be indented by two tab-stops, NOT indented to align with the '(' (not sure which cinoption this is, but this is how vim behaves...):
// ^ ^ tab stops
This is how MonoDevelop already does things when you enter a newline immediately after the '('. HOWEVER, when the first argument is on the same line as the method name, this should CONTINUE to be the case:
// ^ ^ tab stops
The reason that I find the current behavior to be undesirable is that frequently the method name can (and will!) change (e.g. refactoring), but the argument list on following lines will not change. The result is that things look WRONG:
// CURRENT, post-refactoring
Things no longer line up properly. By ALWAYS indenting by two indents and not aligning to the '(', surrounding code doesn't need to be fixed during refactoring, minimizing the number of whitespace-only changes that need to be reviewed in the `git diff`. This also makes indentation more consistent, and makes things look nicer (imho).
The "two-tabstop" indent is, unfortunately, variable; the intent is to indent things to be distinct from following lines, but within nested expressions only one additional tabstop should be required:
// ^ ^ ^ ^ ^ ^ ^ ^ tab stops
In the above, the "outermost" Console.WriteLine() invocation has arguments indented by two tabstops, while the nested MethodInvoke() invocation only has its arguments indented by one additional tabstop.
This also applies to within `if` conditional expressions:
uN Same as (N, but for one level deeper. (default 'shiftwidth').
if (c123456789 if (c123456789
&& (c22345 && (c22345
|| c3)) || c3))
It applies for any use of '(', not just method invocations, but I find method invocations to be most common.
We're now tied to the vs.net indentation system which doesn't support this indentation style.