How to perform an action during every startup of MPS?

Consider i have to check for the existence of a file at every startup of MPS. I have  the code for file check inside an MPS action. This should be invoked automatically at every startup. How can i trigger it automatically? or is there any other way to perform the file check at startup?

Comment actions Permalink
Official comment

The easiest way to do this inside MPS, if your check does not need indexing to be finished or some other IDE functionality, is to create Application component (like in this comment) and put your code inside init block (you can also extract it somewhere and call from both startup / action, if you need to use action in IDE).
But it can lead to IDE startup fail, if your code throw some exception.

So after that you can create MPS plugin with this check and install it in MPS, so it will be triggered on every MPS startup.

PS if you need this action on some exact project you can also use Project component or even better to use com.intellij.openapi.startup.StartupManager and register one of startup activities it allows to create.

Comment actions Permalink

Thanks for the response Victor. Will check the given steps.


Please sign in to leave a comment.