boolean (@NotNull Document document) { VirtualFile file = FileDocumentManager.getInstance().getFile(document); if (file != null && file.isValid()) { for (FileViewProvider provider : getContext().myReformatElements.keySet()) { if (file.equals(provider.getVirtualFile())) return true; } } return false; }