Hooking into GitVcs activate\deactivate methods
Hi,
I'm creating a plugin that depends on the git4idea plugin.
Specifically, I want to install a statusbar widget alongside the git one, after GitVcs' activate method gets called.
Is there a way to hook into GitVcs's start\shutdown\activate\deactivate methods? Some sort of listener interface or event system?
Thanks :)
请先登录再写评论。
Hi Opher,
currently there is no direct way to hook right after GitVcs.activate() is complete.
The thing you can do - is subscribe to ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED and listen to directoryMappingChanged(). There you can check ProjectLevelVcsManager.getRootsForVcs() and initialize your classes if there are Git roots.
Btw, make sure your plugin depends-on git4idea.