live-plugin icon indicating copy to clipboard operation
live-plugin copied to clipboard

Running plugin with all listeners/extensions in plugin.xml

Open Yoskaldyr opened this issue 10 months ago • 5 comments

Is it possible to run live plugin with all listeners/extensions defined in plugin.xml (Or maybe run created zip file with full plugin inside the plugin folder)?

Yoskaldyr avatar Apr 01 '24 20:04 Yoskaldyr

Is it possible to run live plugin with all listeners/extensions defined in plugin.xml

At the moment live plugin just runs the code in plugin.kts (or plugin.groovy). In theory, nothing stops it from parsing plugin.xml and (un)load all the related listeners/extensions. I experimented with it to load actions in about 50 lines of Kotlin. It quickly becomes tricky and it essentially reimplements the functionality of IntelliJ plugin loader.

You can also try https://plugins.jetbrains.com/docs/intellij/dynamic-plugins.html with auto-reload https://plugins.jetbrains.com/docs/intellij/ide-development-instance.html#enabling-auto-reload I looked at it a couple years ago and it was restarting IDE anyway, but it might work better now 🤷

Or maybe run created zip file with full plugin inside the plugin folder

Not sure I understood this 🤔

dkandalov avatar Apr 02 '24 20:04 dkandalov

Not sure I understood this 🤔

Create Kotlin Plugin Zip feature creates zip file with plugin that can be loaded like classic plugin. And before creating zip-file, plugin.xml file can be edited (more listeners/extension is added etc). So it will be great if this zip file can be run directly from the Live Plugin

Yoskaldyr avatar Apr 02 '24 20:04 Yoskaldyr

👍 plugin.xml by live plugin is only editable to specify plugin id, name and description. I haven't tried addition more listeners/extensions.

Do you want to plugin.xml because it's more obvious how to register listeners/extensions?

dkandalov avatar Apr 02 '24 21:04 dkandalov

Do you want to plugin.xml because it's more obvious how to register listeners/extensions?

yes. But only because JB is still changing internal plugin API now and hard to find examples how to extend something in realtime. But xml definition is staying the same long period of time.

For me approach of your addon is much-much better, especially for a small plugins. I can see result of my code changes almost instantly. And standard plugin creation workflow is just overkill for such small changes.

Yoskaldyr avatar Apr 02 '24 21:04 Yoskaldyr

I need custom idea plugins just for own small team productivity (and maybe for community if it get some interest). But not for creating BIG and COMPLEX paid plugins. That's why your plugin is the best for such things👍

Yoskaldyr avatar Apr 02 '24 21:04 Yoskaldyr