boolean () { FileDocumentManager documentManager = FileDocumentManager.getInstance(); VirtualFile virtualFile = documentManager.getFile(myDocument); return virtualFile != null && virtualFile.isValid(); }