Indexing issue
Hi,
In my plug-in I'm copying numerous models, rebuilding them and performing some operations on them in a loop. It's a huge plug-in and the whole process takes over an hour. But during this process at some point MPS points out that "Generation is not available until indices are built", probably when plug-in is trying to rebuild some model. How to wait for the indices to get build before performing any operation or rebuilding the newly copied model?
Or if some one can explain how does indices building works in MPS?
Please sign in to leave a comment.
Hi Hassan,
In Idea based IDEs (and so in MPS) such state is called Dumb mode. This mode is active while indices are build and so functionality is limited.
If you triggering build from your code, then you can do this things:
com.intellij.openapi.project.DumbService#runWhenSmart - for run as soon as possible (but need to check that you have not entered another dumb mode)
com.intellij.openapi.project.DumbService#repeatUntilPassesInSmartMode - to pause your thread and wait until it can be runned (checks and reschedule if new dumb mode was started)
com.intellij.openapi.project.DumbService#smartInvokeLater - schedule runnable for later on EventDispatchThread when there is no dumb mode.