PluginManagementPolicy Extension Point
Answered
I am using com.intellij.openapi.updateSettings.impl.PluginDownloader, and for my use case I needed to update the default PluginManagerPolicy. I found in this XML file code that suggests com.intellij.ide.plugins.PluginManagementPolicy is an extension point, but when I tried this the build failed with the error Execution failed for task ':buildSearchableOptions'.
After some experimentation, I found that
<applicationService serviceInterface="com.intellij.ide.plugins.DefaultPluginManagementPolicy" serviceImplementation="com.path.to.MyPluginManagementPolicy"/>
seems to have worked. However, in general is there a way to find what the valid extension points are?
Please sign in to leave a comment.
Hi Kevin,
PluginManagementPolicyis not an extension point but an interface of a registered application service. It is also a part of internal API, not allowed for use by 3rd-party plugins.I don't understand what has worked for you. Is your service called after registering it under the DefaultPluginManagementPolicy interface? Or just the build passed? The “Execution failed for task ':buildSearchableOptions'” seems unrelated random error to me.
I was mistaken; it was just the build that passed, but the functionality didn't work.
My use case is that I have extension A which I want to either upgrade or downgrade extension B. If PluginManagerPolicy cannot be used by 3rd-party plugins, is there a way for com.intellij.openapi.updateSettings.impl.PluginDownloader to support downgrading plugins at the moment?
Could you please provide more information about your use case? How do you use PluginDownloader?
I have an extension download URL which I use to create a pluginNode. My code looks something like the below:
Just checking in again; is there a recommended workaround for this?
Hi,
Sorry for the delay. By the use case I meant the functional use case you are trying to implement. How does the feature work from the user perspective? How is it triggered? What is the expected behavior? This information is required to understand whether an alternative solution exists.
The idea is that an admin is able to modify an (internal) URL to provide a custom download link. From the user's side, the idea is that the user needs to just set the URL in extension A, and version changes can happen automatically in extension B.
Currently this allows the admin to automatically update the main extension B for all users with the proper URL; I'm am looking to allow automatic rollbacks as well.
Thank you for the clarification.
I've got a response from a responsible developer that
PluginManagementPolicyis not intended to be used by 3rd-party plugins. There is no other extension point for this capability. If it is crucial for you, I suggest creating a platform feature request at https://youtrack.jetbrains.com/issues/IJPL.Thanks for the help. For now I'm using a workaround where I display a notification prompting the user to uninstall plugin B, which allows plugin A to redownload it upon reload.