boolean (@NotNull Document document) { if (document.isWritable()) { return true; } VirtualFile file = FileDocumentManager.getInstance().getFile(document); if (file != null && file.isValid() && file.isInLocalFileSystem()) { if (file.getUserData(TEMP_FILE_KEY) == Boolean.TRUE) return false; // decompiled file can be writable, but Document with decompiled content is still read-only return !file.isWritable(); } return false; }