code format option causes header file reordering.
All,
If I use the code format option (Edit->Format) then the code is re formatted - I love this feature!
However, it seems to alter the order of the Include files - which quite often breaks the compilation.
I have to cut and paste the section with #includes before/after formatting to mitigate this. Not the end of the world, but a really odd feature!
Am I missing something here?
Mark
-
Hi Mark,
To disable include sorting, set the Text Editor > Formatting > Sort Includes environment option to No.
If you want to keep include sorting enabled but have a source file that requires a specific include order, add a line break or comment between the includes. For example:
#include <stdint.h>
#include <stddef.h>
// Must come after stdint.h
#include "myheader.h"Regards,Jon
Please sign in to leave a comment.
Comments
1 comment