I'm working on a compiler plugin, and want to integrate existing compiler messages into the IntelliJ compilation message area. So I plugged a bit of code into my compiler's logging framework to redirect all logging output to CompileContext.addMessage().
This works fine in simple cases, but when there is a significant number of classes being processed (and correspondingly, a significant number of warning messages generated), the compilation becomes very slow, and when control eventually leaves my compiler plugin, the compilation dialog remains and cannot be closed. The only recourse is to force-kill IDEA.
Changing my plugin to not use CompileContext.addMessage() makes the problem go away.
Is this expected? Are there any known limitations with respect to the number of messages that can be written to the CompileContext?
My compiler plugin code is doing a minimal amount of work with the CompileContext / ProgressIndicator APIs. Are there any best practices for exactly what methods should and should not be called?