how to disable a plugin for the current session only

I have a plugin, which can fail during initialization (say, when Project SDK is not set). I want to show an error message to user and disable the plugin for the current session only.
The idea is that the user will configure the Project SDK and restart IDEA, then the plugin can initialize properly.
I see PluginManager.disablePlugin() will disable it permanently.

The reason why I want to disable the plugin in the first place is that we have a language parser and other stuff there, which would throw NPEs if not properly initialized.

2 comments
Comment actions Permalink

maybe we could throw something like "PluginInitException" to indicate  that the plugin should be disabled for the current session

0
Comment actions Permalink

Hello Alexey,

There is no possibility to disable a plugin for a session. If we've already
started to load your plugin and run your initialization code, it's too late
to disable the rest of it anyway.

I have a plugin, which can fail during initialization (say, when
Project SDK is not set). I want to show an error message to user and
disable the plugin for the current session only.

The idea is that the user will configure the Project SDK and restart
IDEA, then the plugin can initialize properly.

I see PluginManager.disablePlugin() will disable it permanently.

The reason why I want to disable the plugin in the first place is that
we have a language parser and other stuff there, which would throw
NPEs if not properly initialized.


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


1

Please sign in to leave a comment.