CompileContext.addMessage() woes (I think)

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?

-Patrick

2 comments
Comment actions Permalink

Patrick Linskey wrote:

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.


I've seen similar behavior when running Ant scripts that produce a large amount of
output and the messages are displayed as a list/tree. In case of Ant the solution
is to run or switch the script to text-only output. Makes me believe that this is
a general problem with the tree-like display of whatever messages.

I'll try to wrap up a reproducible testcase about the Ant problem and submit it.
If it's fixed this will probably solve your problem as well. My gut-feeling however
is that Swing's JTree just doesn't go with large data models, so we'll have to see
what solution JB come up with :(

Sascha

0
Comment actions Permalink

Are you talking about Pallada (IDEA 4.5.x) or Irida (current EAP)?

--
Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

Please sign in to leave a comment.