https://kotlinlang.org logo
#arrow-meta
Title
# arrow-meta
s

shikasd

02/14/2020, 1:25 AM
hey, I was looking into ide plugin install and found out this task in gradle plugin: https://github.com/arrow-kt/arrow-meta/blob/b39158f3999e8963985c1bc8b5e31ccb16bdd2ef/gradle-plugin/src/main/kotlin/arrow/meta/plugin/gradle/InstallIdeaPlugin.kt I am a little bit curious, will it provide platform for other meta based plugins to be (at least partially) hot-swappable or we will have to create and install a separate ide plugin to match compiler ones?
r

raulraja

02/14/2020, 10:29 AM
The whole thing with installing the plugin is because IDEA requires users to go through a marketplace to get community plugins
We believe that is not ok
We would like to help having IDEA plugins autodiscovered as regular dependencies in project workspaces
Until that happens Meta has the ability to auto install itself from gradle into the user IDEA instance by copying and keeping the meta plugin updated and in sync with the Kotlin plugin the user depends on
I’m not sure if this work is completed but @Rachel can clarify
r

Rachel

02/14/2020, 10:54 AM
🙌 Yes, you can run
install-idea-plugin
Gradle task to install the IDEA plugin. Pending task: remove the request to restart the IDE after doing the changes for a dynamic plugin (and I'm not sure if this consideration is already available in the current IDEA version)
The message about that task appears when running Gradle from Intellij IDEA
It checks if IDEA plugin is installed and in case it's missing, it shows the info to install it
s

shikasd

02/14/2020, 12:44 PM
I was more curious if the auto discovery feature could work in arrow specific cases similar to gradle configuration in IDE. E.g. user already has ide meta plugin installed with higher kind support, he applies another gradle plugin (my own changes) and that one gets discovered automatically and connected to existing IDE plugin.
r

Rachel

02/17/2020, 10:13 AM
Thanks for the idea @shikasd!
r

raulraja

02/17/2020, 10:29 AM
That should work out of the box if your idea plugin depends on the meta idea plugin in the same way we depend on the Kotlin plugin
👍 1
We need to add docs on how to do that /cc @Imran/Malic
i

Imran/Malic

02/17/2020, 1:58 PM
Will do, I will add a PR to https://github.com/arrow-kt/arrow-meta-examples, by the end of the week. We’re currently, rewiring the internals regarding ide registration, to remove a bug we had opening multiple projects. If that bad experience is removed, I’ll be pushing examples and docs. Regardless of the former, it works as Raul mentioned, because gradle (with the task) will add another ide plugin. Similar to how users would install it manually, through the marketplace. Ide Plugins build with Meta work in isolation, if you depend on the Meta dsl you can define your own workflows, without adding the ones we have implemented for HKT, optics, etc.
s

shikasd

02/17/2020, 4:40 PM
Yes, but it is like a usual plugin dependency, which requires a restart and all of that 🙂 I was imagining more of a hot-plug solution, like gradle sync in idea, e.g. if you have jar with plugin in the classpath it will hook up somehow automagically
i

Imran/Malic

02/17/2020, 4:44 PM
A somewhat similar idea is proposed in IntelliJ with Dynamic Plugins. https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/dynamic_plugins.html If you define a Meta Plugin that satisfies all those restrictions than your users can get that experience. There is a roadmap for that and other ideas here https://github.com/arrow-kt/arrow-meta/issues/449
But the exact experience is still undefined, because it is not available, yet.