My plugin is parsing annotations and depending on their placement and content the plugin will add/change code in the editor. For instance adding getters and setters when there is a @Get and/or @Set annotation. I want this to be reasonably "live" so that the user don't have to do anything. The code should just appear automatically when the user adds the annotation.
I know how to listen for changes both in the Document and PsiTree, however I want to make this a bit more performant and scalable. So, I'm looking for a way to recognize changes and basically batch the creation/alteration of the methods. The batch should then be executed when convenient, say every 1000 ms or maybe when the user stopped typing. Sort of like when you reparse the code in IDEA.
Is there a fitting class/manager that handles this already?
I would like to use whatever framework you already have in place in IDEA, since it would be wasteful to create a new one for something that you probably already have.
Any pointers would be appreciated.