Code folding doesn't work for #if #else #endif

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JoBr_1593366
Level 5
Level 5
100 sign-ins 50 questions asked 100 replies posted

If the code has

#if (something)

    some = code;

#else

    some = other(code);

#endif

Then it should be possible to fold up whichever branch is unused to hide them from view.  PSoC Creator only allows folding up the entire #if-#endif block, though.

Also, it should be possible to fold/hide unused code by default when a file is open so there is less clutter.

PSoC Creator  4.2 (4.2.0.641)

0 Likes
1 Solution
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

We understood what you are saying. It is a good idea.

Our software developers might thought that generally #if #endif statements are used in generated code/generated source sections where the selection is mainly based on the device family. Since user can actually go and see the configuration, it is better to make the user go through the entire flow for better understanding.

Anyways, we will inform this to our software team to consider this in future versions

Thank you

Ganesh

View solution in original post

0 Likes
1 Reply
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

We understood what you are saying. It is a good idea.

Our software developers might thought that generally #if #endif statements are used in generated code/generated source sections where the selection is mainly based on the device family. Since user can actually go and see the configuration, it is better to make the user go through the entire flow for better understanding.

Anyways, we will inform this to our software team to consider this in future versions

Thank you

Ganesh

0 Likes