csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

#if directive changes indentation

Open belav opened this issue 2 years ago • 0 comments

Using the following code, if you change it between TODO and !TODO for the #if's, the indentation level changes.

Could we detect this somehow and make sure to use the indentation that visually makes sense? Or maybe this is so edgecase that we don't really care.

This is a real file that has the issue, it is probably incredibly rare. https://github.com/belav/csharpier-repos/blob/main/runtime/src/libraries/Common/src/System/Security/Cryptography/RSACng.EncryptDecrypt.cs

namespace Namespace
{
#if TODO
    public class ClassName
    {
#endif
    public class ClassName2 { }
#if TODO
    }
#endif
}

belav avatar May 09 '22 19:05 belav