csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

#if causes line after it to break when it contains an if

Open belav opened this issue 3 years ago • 0 comments

When there is this if statement inside of the #if the LogHelper line breaks even though it is not that long. If the #if contains var x = 1; then LogHelper does not break.

public class ClassName
{
    public void MethodName()
    {
#if !NET6_0_OR_GREATER
        if (true)
        {
            return;
        }
#endif
        LogHelper
            .ForType(typeof(ErrorHandler))
            .Error(message, source);
    }
}

belav avatar May 12 '22 15:05 belav