07-21-2011 04:50 AM
I really like eclipse autoformat (ctrl+shift+F) and organize imports (ctrl+shift+O).
However, if the file uses preprocessing, both of these functions make the code unusable.
- organize imports moves the //#ifdef line behind the line above, rendering it useless.
i have found a workaround, if you put // behind the line above it will stay where it belongs.
autoformat puts an indention before the //#ifdef and the compiler stops using it.
VerticalFieldManager screenVfm; //#ifdef VER_4_6_0_AND_ABOVE
VerticalFieldManager screenVfm; // #ifdef VER_4_6_0_AND_ABOVE
did anybody find (or know) a way to either
- disable the autoformat of eclipse for the preprocessing tags
- get the compiler to use them even if they are not at the start of the line
my habits are really hard to control (and giving up autoformat/organize imports is not really a solution) and i am getting frustrated when i have to re-format all 15 preprocessor tags.
07-28-2011 02:28 PM - edited 07-28-2011 02:28 PM
You can prevent the automatic formatter from formating the preprocess code by disabling the “Enable line comment formatting” (the 3rd checkbox in the General settings) of the format profile you are using. This way eclipse formatter will not format comments.
08-08-2011 04:35 AM