void (VirtualFile vFile, @NotNull String newName) { FileType newFileType = FileTypeRegistry.getInstance().getFileTypeByFileName(newName); if (UnknownFileType.INSTANCE.equals(newFileType) || newFileType.isBinary()) { FileDocumentManager fdm = FileDocumentManager.getInstance(); Document doc = fdm.getCachedDocument(vFile); if (doc != null) { fdm.saveDocumentAsIs(doc); } } }