Document document = e.getDocument();
final FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();
VirtualFile file = fileDocumentManager.getFile(document);
if (file == null || file.getFileType() != BnfFileType.INSTANCE) return;
finalQueue.cancelAllUpdates();
finalQueue.queue(new Update(Boolean.TRUE, true) {
@Override
public void run() {
FileManager fileManager = ((PsiManagerEx)PsiManager.getInstance(project)).getFileManager();
for (FileEditor fileEditor : fileEditorManager.getAllEditors()) {
if (!(fileEditor instanceof TextEditor)) continue;