what are the implications of using contentsChanged (vide : VirtualFileListener) vs beforeContentsChange virtual file event ?
My experiments suggest that from beforeContentsChange callback method I can query the PSI structure of the modified file - as it has not been invalidated yet - but are there any other, possibly not so obvious - differences between these two?
Also, I've noticed that after reverting latest changes using git revert or simple 'Undo' operation (ctrl + z), *contentsChange* events seem not to be propagated at all - am I correct?
Moreover - on some occasions the event gets propagated before I hit ctrl + s to save the edited file and the changes are not reflected in an object tree I build based on it - for example when I comment or uncomment a line using ctrl + / key shortcut.
So the next question is : what triggers these events, if not file save operation ? (I thought that IDEA may have some 'autosave' functionality enabled by default but I have found no such option in Settings - besides 'force save on frame activation / deactivation').
EDIT: 'autosave' functionality shouldn't pose a problem since it is semantically equivalent to simple ctrl + s - the only difference being the 'trigger' (automatic instead of manual).
Thank you in advance for any clarification,