[MonoDevelop] New code formatter joins line to aggressively

Oskar Berggren oskar.berggren at gmail.com
Tue Sep 15 10:50:44 EDT 2009


Hi again, sorry for late reply.

>From the previous mails in this thread I get the impression that the
document formatter and the on-the-fly formatter are separate? Use
separate implementations of the algorithms? If I want to study the
implementation, where would I start?

I agree that automatically wrapping overly long lines is probably not
doable in a reasonable way. If experiments are done to implement this,
it must surely be made optional at runtime, probably with default off.

Wrapping comment blocks might be a different thing. I've used a very
helpful visual studio extension that does this. Is something similar
available for MD? I do believe this should be separate from the code
formatter, so that the comment wrapper can be invoked manually on a
specific comment block.

Another suggestion:
Currently, in MD 2.2 beta 1 (with brace-on-new line)
using (IDisposable a = null)
    using (IDisposable b = null)
    {
        int c;
    }

For the case of several using statements in sequence, a certain other
IDE seems to have an exception so that this is instead formatted:
using (IDisposable a = null)
using (IDisposable b = null)
{
    int c;
}

In my opinion this is much nicer in that it doesn't waste so much
horizontal screen space, especially when having three or more
using-statements.

The rule would be, I suppose: If the child of a using-statement is
another using-statement (with no intervening opening brace), then
don't indent the child.


/Oskar



2009/9/14 Mike Krüger <mkrueger at novell.com>:
> Hi
>
>> True, manual splitting will almost invariably be better than automatic
>> splitting. Preserving such breaks is the best solution.
>>
>
> I think I'll add an auto split option (I don't add it for 2.2  feature
> freeze) - doesn't really hurt. But it'll be disabled by default :)
> I want to improve the document/on the fly formatter for the 2.2 release.
>
> Regards
> Mike
>
>


More information about the Monodevelop-list mailing list