How to detect import completion in DocumentEvent?

Answered

I'm using a caret, document and selection listener to track changes to a document. While the document is being edited, things are fine. However, when import completion triggers, the caret jumps to the beginning of the file, the system inserts the using statement, the caret jumps back. The user doesn't see it, of course, but events for these changes are generated.

How can I detect that import completion is taking place when receiving a caret/document/selection event? Basically I want to filter (= avoid recording) them.

0
1 comment

You could try and determine context/parent PSI structure and determine whether it is in irrelevant place for your needs.

0

Please sign in to leave a comment.