diff --git a/platform/platform-impl/src/com/intellij/openapi/command/impl/CommandBuilder.java b/platform/platform-impl/src/com/intellij/openapi/command/impl/CommandBuilder.java index 3c09e2fd417d..916ae1c27273 100644 --- a/platform/platform-impl/src/com/intellij/openapi/command/impl/CommandBuilder.java +++ b/platform/platform-impl/src/com/intellij/openapi/command/impl/CommandBuilder.java @@ -211,7 +211,7 @@ final class CommandBuilder { private @NotNull UndoMeta createUndoMeta() { var actions = ContainerUtil.map( undoableActions, - a -> ActionMeta.create( + a -> UndoableActionMeta.create( UndoableActionType.forAction(a), a.getAffectedDocuments(), a.isGlobal() diff --git a/platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/UndoMeta.kt b/platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/UndoMeta.kt index 97f74ef13245..947f42fd836e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/UndoMeta.kt +++ b/platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/UndoMeta.kt @@ -8,7 +8,7 @@ import com.intellij.openapi.project.Project interface UndoMeta { fun undoProject(): Project? fun focusedEditor(): FileEditor? - fun undoableActions(): List + fun undoableActions(): List fun isForcedGlobal(): Boolean companion object { @@ -19,10 +19,10 @@ interface UndoMeta { @JvmStatic fun create( - project: Project?, - editor: FileEditor?, - actions: List, - isForcedGlobal: Boolean, + project: Project?, + editor: FileEditor?, + actions: List, + isForcedGlobal: Boolean, ): UndoMeta { if (project == null && editor == null && actions.isEmpty() && !isForcedGlobal) { return EmptyUndoMeta @@ -32,21 +32,21 @@ interface UndoMeta { } private class ImmutableUndoMeta( - private val project: Project?, - private val editor: FileEditor?, - private val actions: List, - private val isForcedGlobal: Boolean, + private val project: Project?, + private val editor: FileEditor?, + private val actions: List, + private val isForcedGlobal: Boolean, ) : UndoMeta { override fun undoProject(): Project? = project override fun focusedEditor(): FileEditor? = editor - override fun undoableActions(): List = actions + override fun undoableActions(): List = actions override fun isForcedGlobal(): Boolean = isForcedGlobal } private object EmptyUndoMeta : UndoMeta { override fun undoProject(): Project? = null override fun focusedEditor(): FileEditor? = null - override fun undoableActions(): List = emptyList() + override fun undoableActions(): List = emptyList() override fun isForcedGlobal(): Boolean = false } } diff --git a/platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/ActionMeta.kt b/platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/UndoableActionMeta.kt similarity index 77% rename from platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/ActionMeta.kt rename to platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/UndoableActionMeta.kt index f69be84dc9a8..c4d1d100be04 100644 --- a/platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/ActionMeta.kt +++ b/platform/platform-impl/src/com/intellij/openapi/command/impl/cmd/UndoableActionMeta.kt @@ -5,24 +5,24 @@ import com.intellij.openapi.command.impl.UndoableActionType import com.intellij.openapi.command.undo.DocumentReference -interface ActionMeta { +interface UndoableActionMeta { fun type(): UndoableActionType fun affectedDocuments(): Collection? fun isGlobal(): Boolean companion object { @JvmStatic - fun create(type: UndoableActionType, affectedDocuments: Array?, isGlobal: Boolean): ActionMeta { - return ActionMetaImpl(type, affectedDocuments?.toList(), isGlobal) + fun create(type: UndoableActionType, affectedDocuments: Array?, isGlobal: Boolean): UndoableActionMeta { + return UndoableActionMetaImpl(type, affectedDocuments?.toList(), isGlobal) } } } -private class ActionMetaImpl( +private class UndoableActionMetaImpl( private val type: UndoableActionType, private val affectedDocuments: Collection?, private val isGlobal: Boolean, -) : ActionMeta { +) : UndoableActionMeta { override fun type(): UndoableActionType = type override fun affectedDocuments(): Collection? = affectedDocuments override fun isGlobal(): Boolean = isGlobal