<@U2SG23BPU> <@UKPEELJCW> I have been looking arou...
# compiler
r
@dsavvinov @dmitriy.novozhilov I have been looking around for solutions of having a compiler plugin automatically register the IDEA plugin needed if there is codegen involved and new synthetic members. For others reading this… Currently compiler plugins shipped from JB or Google have direct access to IDEA features because the IDEA part of the plugin is bundled alongside IDEA or AS. Community plugins like the ones we are writing in Arrow can’t activate automatic recognition of generated synthetic declarations. This makes IDEA show redlines in all generated code unless the user manually installs a plugin. I stumbled upon this https://intellij-support.jetbrains.com/hc/en-us/community/posts/206163949-Doing-automatic-installation-of-plugin which makes me think we can potentially copy the IDE specific jar of a compiler plugin directly to the user plugins folders via a gradle task that is part of the gradle plugin bootstrap. The idea plugin will then watch for new class files added to the output folder and whenever it finds a change it will retrigger parsing so those binaries are accounted for and redlines/autocompletion etc works again. Does this sound like a good approach or are we not seeing the obvious limitations?. The end goal is to not have users install both a gradle plugin and an idea plugin manually in order to user a community based compiler plugin.
today i learned 1
d
The part about installing plugin seems fine for me. I mean, you’re basically distributing gradle script alongside with your gradle plugin, which will download and install plugin. You obviously have to be careful if you want it to be executed automatically (e.g., it shouldn’t re-install plugin if user has added new modules to their project), but that’s Gradle technical details. The part about “output folder” still sounds a little bit fishy for me: that’s a basic “indexing” functionality of IDE, and it should be none of the plugin’s concern. I certainly miss the whole picture of your plugin here, so maybe it does make sense for you, but that’s a bit suspicious, yes. We can chat in DM about nitty-gritty details if you would like to
r
Thanks Dmitry, I’ll ping you over DM
h
Raul, thanks for your effort and your dedication. Sounds like a super nice idea and like the missing link if it works. Will take a look at it and probably try it in my spare time plugin somewhen :) Edit: and thank you as well Dmitry, great move that you help in your spare time, much appreceiated!
👍 2