Project model loading and maintenance
Hello!
We are developing a plugin that builds a model for project written with some framework. The model is built to provide user simple method to do the framework specific actions with project. So, on the one side, we should update model, when user changes code or project files, and on the other side, we should commit model changes to PSI when user works with plugin UI.
To work with PSI idea uses ReadAction`s and WriteAction`s. It look likes access to the model should also be made through these actions to maintain integrity.
The problem we faced with, that our model loading is very long and it cannot be done inside write action (otherwise we got freeze).
Is there any approaches to do write action with modal dialog, or to work with heavy project models.
Please sign in to leave a comment.
Yes, read/write actions should be used for accessing project model.
Is all the long activity spent in modifying the model? In many cases, it's possible to split modification into long preparatory "reading" phase and then short "writing" phase where the changes are actually written. There can be several such stages with interleaved read/write operations, and a modal dialog could be shown for all this time.