In my plugin, I create a CompilationStatusListener and perform static analysis on Java code whenever a build occurs. I'm seeing error state get drooled between compilations.
1) User compiles Foo.java
2) My plugin finds an error, I call CompilerContext.addMessage(...)
3) As expected, an error appears in the compiler message window for Foo.java. The editor window for Foo.java file has a red wave underline beneath the tab so the user knows about the error.
4) The user fixes the problem and recompiles.
5) My plugin finds no errors, so no errors appear in the compiler message window. It seems like Intellij will automatically clear out previous compiler messages, correct? The life cycle for managing error messages is not explicitly stated in the JavaDoc for addMessage(...).
6) BUG: Even though there are no errors in the compiler message window, the editor window for Foo.java still has a red wave underline. If I close the editor for Foo.java and reopen it, the tab still has a red wave underline. Therefore, this is most likely not a Swing painting issue. All of my calls to addMessage are on the EDT thread.
It seems like state from CompileContext.addMessage is getting drooled and not cleared out.
Is a plugin responsible for clearing out messages or Intellij IDE? Is there a removeMessage(...) method that I should be calling?
Thanks in advanced!