Skip to content

An option controlling the indentation of code #if blocks should be provided. #12306

Open
@tannergooding

Description

@tannergooding

Currently #if blocks are always formatted to start at the beginning of the line:

public class ExampleClass
{
    public void ExampleMethod()
    {
#if DEBUG
#endif
    }
}

An option should be provided so that the #if block can be indented to the desired level (probably the same options as label has, which are left-most, indent one less, and indent normally):

public class ExampleClass
{
    public void ExampleMethod()
    {
#if DEBUG
        // Some code
#endif
    }
}
public class ExampleClass
{
    public void ExampleMethod()
    {
    #if DEBUG
        // Some code
    #endif
    }
}
public class ExampleClass
{
    public void ExampleMethod()
    {
        #if DEBUG
        // Some code
        #endif
    }
}

It would also be useful, in the last example, to be able to indent the contents one more level:

public class ExampleClass
{
    public void ExampleMethod()
    {
        #if DEBUG
            // Some code
        #endif
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Complete

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions