Closed phil000 closed 1 year ago
Can you test if the #if (DEBUG)
versus #if DEBUG
makes a difference with CodeMaid?
Thanks for reporting the issue. By default CodeMaid detects preprocessor conditionals and prompts if you want to proceed with a reorganization. When running a reorganization a box like this should(tm) pop up:
If you're not seeing that prompt, can you check the setting at CodeMaid->Options->Reorganizing->General->Perform reorganization when preprocessor conditionals are present ?
Hello,
That setting is turned on.
The behavior is unpredictable, as this
#if DEBUG
private int z = 5;
#endif
private int x = 10;
private int y = 100;
gets cleaned into this:
#if DEBUG
private int x = 10;
private int y = 100;
private int z = 5;
#endif
It sounds like the preprocessor directive detection is failing if you're not seeing the warning prompt. Do you have a minimal solution that reproduces the issue that you can share?
Hi, Please close this case. I only raised this issue to see if preprocessor directives could actually be handled better. This file and most others we have do need to be cleaned, so we've altered the structure to remove preprocessor directives or place them in a file of their own.
It sounds like the preprocessor directive detection is failing if you're not seeing the warning prompt. Do you have a minimal solution that reproduces the issue that you can share?
I also see this issue. Although my settings is set to "ask" there is no warning prompt so all conditional statements are reorganized all the time.
In my case it always deletes the " #endif " statement.
Thanks for reporting Pinox. Same ask as above, can you please provide a minimal solution that exhibits the issue?
Environment
Description
CodeMaid is not handling conditional compilation on 'Cleanup' document.
Current behavior
Shifts code about inappropriately.
Expected behavior
Doesn't shift code about inappropriately.
e.g. Start with:
Perform cleanup.
End up with: