Impossible to pass options to plugins?

I'm using IntelliJ 11.1.3 to develop a Scala compiler plugin. I have one module configured to generate the plugin itself as a jar file. Aside from some spurious errors produced by IntelliJ (an issue for another day) this is working fine. I have another module configured to use the plugin on some sample code. This second module is intended to be a quick and dirty test of the plugin and a kind of sandbox for experimenting with the plugin.

In the settings for my second module, in the Scala facet dialog, I've added my plugin's jar file to the list of "Compiler Plugins." Based on the errors I'm getting this seems to work fine in the sense that my plugin is being located and loaded when I compile the module. My plugin reads a configuration file the name of which is passed via a -P option to the compiler. I've set up this option in the "Additional compiler options" box.

The system behaves as if the configuration file is not being found. It looks like the options in the file are not processed. So my question has two parts:

First, are the "Additional compiler options" applied before or after the options that include the plugin on the compiler's final command line? I may be wrong but I have a belief that the options that load the plugin must appear before the options sent to the plugin itself. If scalac's command line is being constructed in some other way that might account for what I'm seeing (and if it does... is there a workaround?)

Second, I'd like to see the raw output of the compiler somehow. I could easily add a few choice println statements to my plugin to output debugging information during compilation. However IntelliJ's message window seems to only show a highly digested view of the output (basically a list of errors and warnings). I suppose I could embed my plugin's debug output into error messages but that seems like a hack. Surely there is a simple way of just viewing the raw output, yes?

Peter

1 comment
Comment actions Permalink

I actually asked this question earlier this year and an issue was created for it here

     http://youtrack.jetbrains.com/issue/SCL-4377

Sorry about generating noise... I guess I forgot about my earlier question.

That said, I'm still wondering about the second part of my question... namely the part about seeing the raw compiler output. My plugin actually creates a number of semi-useful messages during compilation that the developer might want to see. Ultimately I intend to put these messages behind an option to avoid confusing tools that aren't expecting them. However, a developer using my plugin with IntelliJ might want to activate the messages now and then and it appears that doing so isn't useful because, I guess, there's no easy way to view the raw compiler output. Or is there?

0

Please sign in to leave a comment.