Recommended design for reacting to file changes

I have an in-house plugin for IDEA which parses out i18nized calls to our logging system and displays a toolwindow with a list of the message tokens and their corresponding messages from the resource bundle for editing.

What would be the best way to react to changes in the files to update the list?

Currently I'm using a DocumentListener and on the documentedChanged event, I start a 500ms timer which triggers a rescan of the source file (using PSI). Is there a better way to do this?

Compatiblity with IDEA 6 is required.

Thanks,
Gordon

Please sign in to leave a comment.