Visual studio - auto formatting - column mode or recommendation

I use auto-formatting as the default for all documents, but some parts of the code are more readable if left in column mode (like below).

   switch (itUnit)
    {
        case ItUnit.NotApplicable:        return -1;
        case ItUnit.KilometersPerHour:    return 1;  
        case ItUnit.MetricTons:           return 1;
        case ItUnit.Centimeter:           return 0.01f;

      

I don't want to stop auto-formatting files with a column style function or two. I am looking for some option to help me with this. Maybe something like EditorGuidelines , but this automatic format doesn't ignore them (for example, it ignores the linked version). Or some option to mark some parts of the code that should be ignored by formatting. Or maybe a third party formatter that supports recommendations?

Autoformat will do the following:

    switch (itUnit)
    {
        case ItUnit.NotApplicable: return -1;
        case ItUnit.KilometersPerHour: return 1;
        case ItUnit.MetricTons: return 1;
        case ItUnit.Centimeter: return 0.01f;

      

+3


source to share





All Articles