format icon indicating copy to clipboard operation
format copied to clipboard

Should format code even if it is hidden in conditional compilation directives under the current solution configuration

Open siegfriedpammer opened this issue 3 years ago • 3 comments

It would be nice to be able to tell dotnet-format that it should ignore any conditional compilation directives when formatting code.

Real world use-case: https://github.com/icsharpcode/ILSpy/blob/master/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.cs#L568-L580

In the above code, I would like the formatter to process both branches of the #if directive.

siegfriedpammer avatar Aug 28 '20 07:08 siegfriedpammer

Has there been any update on this? I've got a similar use-case but for a Unity specific library for both iOS and Android which has code inside #if UNITY_IOS and #if UNITY_ANDROID which isn't being formatted right now

MileyHollenberg avatar Jan 17 '22 10:01 MileyHollenberg

yes, please fix the issue

dront78 avatar Jan 20 '22 17:01 dront78

Any update on this?

YuriHeupa avatar Oct 11 '22 03:10 YuriHeupa