Java editor shows compiler errors, compilation succeeds

Hi,

I have a scenario where a custom annotation processor has been created and used to provide some modifications of the source code Abstract Syntax Tree (AST). While the project builds successfully in IntelliJ IDEA 12.1.6 Community edition, the editor shows some errors also the created methods/fields are not shown in the structure.
I've attached a test project which you can import and see the problem. I'm also attaching a sample diagram of the scenario and a screenshot of the errors in the IDE.

I did some more research and found that IntelliJ uses internal parser of the Java Code (https://github.com/JetBrains/intellij-community/blob/master/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis), which appears to not have notion of the custom annotation processor.

Do you have an idea how we can avoid this in-editor error? Is it possible the java editor to reflect the source code after the annotation processing.

Best Regards,
Dinko

P.S. Writing some custom plugin for IntelliJ IDEA to handle this is also OK if possible and supported by the platform. So please advise if that is achievable.



Attachment(s):
case.png
screen.png
testcase.zip
1 comment

IDEA analyzes sources, not a compiled files - so missing fileld is of couse an error.
Yes, a plugin is needed to support this, the one for Lombok may serve as a reference.

0

Please sign in to leave a comment.