Suppressing Inspections for code disabled by conditional defines
Hello! I wonder if it's possible to disable Inspections for the code that is not relevant/disabled by conditional compilation directives?
We have quite a complex project in different programming languages and parts of our code have definitions of the same variables inside #ifdef defines and IntelliJ Idea warns a lot about duplicate variable definitions. Like
#ifdef SpecificEnvironment
int variable=1
#else
int variable=2
#endif
It's just a small example of what we face, but the problem is much more complex. I want to disable Inspections for the case where SpecificEnvironment is not defined. Is it possible? Eclipse was able to do that.
Thanks!
请先登录再写评论。
It's not supported. What language do you use? What is the standard for ifdef conditions used in this language?
That's so bad :(
We have it written in C++, PHP, Typescript and ActionScript/Flex. We have a lot of conditional defines all around the code in different languages and we try to port it from Eclipse and collect all the code under the same environment - so we were considering IntelliJ as a solution. It worked pretty well in Eclipse.
Do you have it in plans? Are there any workarounds? Any special comments we can add around defines we have in place?
John, is that C++? Do you use CLion or some third-partly C++ plugin?
It's mostly C++ and ActionScript. And we can't drop ActionScript for at least a year or two (because the codebase we have is still quite huge).
IntelliJ IDEA doesn't support C++ code, what do you use to edit/highlight it?
So there's no way to bring all the code under the same environment and there's no way to suppress inspections in the unused define blocks, right?