Symptoms: Project builds and runs successfully, but references to an Annotation Processor are marked as unrecognized by IDEA's Editor.
Cause: The issue stems from the nature of the Annotation Processors, as compiler extensions. Their workflows and output (i.e. Methods they generate) are impossible to determine based off of static code analysis alone.
IDEA gets around this limitation with Plugins, which help IDEA match annotations with corresponding implementations.
Plugins for well-known APs like Lombok are provided by JetBrains, but for less common / custom APs the Plugins have to be provided by the AP's developers.
Solution: In order for IDEA to correctly interpret such AP, a Plugin for it has to be created. Lombok Plugin's source code can be used as a reference, since the new Plugin should follow the same / similar logic.
Note: Some IDEs may provide AP resolution/navigation without the Plugins, but this approach is often less accurate in terms of navigation and also scales poorly, making it unfeasible for larger, more complex Projects.
Because of that, IDEA does not employ this approach and relies on the Plugins instead.
Comments
0 comments
Please sign in to leave a comment.