#ifdef parsing Follow
Code that is currently "inactive" because the #ifdef clause fails is not seen by "usages", which is causing me trouble since I do have a number of preprocessor-defined blocks of code for platform specific actions. A big part of the reason that I started using CLion is because I want to see if it will suit me well for my workflow and having large sections of code controlled by the likes of #ifdef PLATFORM_WEB is a must, and it would be very helpful if CLion could actually see inside those areas.
It seems that most refactoring options work, like Rename.. but I need a toggle to parse all of that code aswell. The attached image clearly shows that the only 2 usages of this function are in the while loop (in the failed case of if defined) and the function's own prototype (not pictured but easily inferred from the list.) If there is something I can do, please help!
Please sign in to leave a comment.
Not sure I got your question correctly.
CLion should properly mark conditionally uncompiled code in accordance with #if/#ifdef and defines. And indeed CLion doesn't provide all smart code features for conditionally uncompiled code.
Do you want smart code features to be provided for conditionally uncompiled code?
Yes! I would prefer to have the smart-code features available for the conditional code, and it would be best if I didn't have to temporarilly place #define tags at the start of a file each time I try to use one :P
There are several feature requests about providing some features for conditionally uncompiled code: https://youtrack.jetbrains.com/issue/CPP-2285, https://youtrack.jetbrains.com/issue/CPP-5568, https://youtrack.jetbrains.com/issue/CPP-2286. Feel free to comment or upvote them. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.