I am building a plugin that listens to all the text changes performed by refactorings.
I am using:
- a VirtualFileListener to listen to file adds / deletes
- a DocumentListener to listen to the changes on all the opened files (using a FileEditorManagerListener to hook up the DocumentListeners when files are opened and closed)
My problem is that, if a refactoring touches files that are not opened in editors (e.g. a rename refactoring that writes into other unopened files), then its changes into the unopened files do not seem to fire any events whatsoever, anywhere:
- no file opened / closed events are generated, therefore no Document listeners can be attached
- no VirtualFileListener.contentsChanged() is triggered, so I cannot listen to the change even at the VirtualFile level. (not even a file save event is fired ... how can this be?)
My question is, what listeners do I need to hookup and where in order to capture text changes performed by Idea in files that are not opened in UI editors?