dcaoyuan / nbscala

NetBeans Plugin for Scala
248 stars 57 forks source link

Any way to use compiler plugins in the presentation compiler? #111

Open fluffysheap opened 10 years ago

fluffysheap commented 10 years ago

In my project, I use the macro-paradise plugin. This plugin extends Scala's macro functionality and allows macros that can change class signatures. These macros can, for example, define entirely new methods and fields on classes.

Unfortunately, the presentation compiler doesn't invoke the macro-paradise compiler plugin, and so Netbeans doesn't know about the changes to the class. In my POM, I'm able to declare the compiler plugin and actually compile the code, but Netbeans still doesn't know about it, and so the IDE mistakenly flags errors that are actually correct code.

So, what I'd like is a way to configure a compiler plugin, so that the IDE's error display is again correct. Although currently I'm pulling the plugin via Maven, I'd be happy if I could just use the equivalent of the -Xplugin: commandline option, but with the presentation compiler.

dcaoyuan commented 10 years ago

Could you give me an example project?

rcano commented 10 years ago

Same here, and this issue is a duplicate of #89 . You can use https://github.com/scalamacros/sbt-example-paradise as an example project, that is also what most people base on to start working with paradise. I think a similar approach to the one taken with scalariform applies, you could extract the settings from sbt using something like show scalacOptions, and do the same in maven. I'd say that plugins is what we seek here, but actually being able to configure all the options is preferable, also I think its the same to just pick the plugins as well as all the other scalac options

fluffysheap commented 10 years ago

Thanks for replying on this. I've been busy and didnt have a chance to prepare a simple demonstration example yet. I'll get an example out to you in a couple of days.

On 4/11/14, rcano notifications@github.com wrote:

Same here, and this issue is a duplicate of #89 . You can use https://github.com/scalamacros/sbt-example-paradise as an example project, that is also what most people base on to start working with paradise. I think a similar approach to the one taken with scalariform applies, you could extract the settings from sbt using something like show scalacOptions, and do the same in maven. I'd say that plugins is what we seek here, but actually being able to configure all the options is preferable, also I think its the same to just pick the plugins as well as all the other scalac options


Reply to this email directly or view it on GitHub: https://github.com/dcaoyuan/nbscala/issues/111#issuecomment-40247131

rcano commented 10 years ago

bump?

fluffysheap commented 10 years ago

Hi, I ended up with a workaround for this, so I never got back to Deng with the information he requested. But it's still on my wishlist :)

On 10/16/14, rcano notifications@github.com wrote:

bump?


Reply to this email directly or view it on GitHub: https://github.com/dcaoyuan/nbscala/issues/111#issuecomment-59463751

rcano commented 10 years ago

I implemented this in my fork only for sbtprojects, since that is what I use annyways, and I did it by reading an optional additional file called .nb_compiler_settings as a workaround. Works for me.