From 323a3bbf72aeba1cfac2d15a155378b5517f6ce7 Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Mon, 13 Oct 2025 23:29:35 +0200 Subject: [PATCH] [completion] IJPL-207762 allow ActionRemoteBehaviorSpecification to default to `null` behavior GitOrigin-RevId: 3f6c460ab7f327779ec057b2352d0c0430502a71 --- .../openapi/actionSystem/remoting/ActionRemoteBehavior.kt | 2 +- .../actions/WelcomeScreenAwareActionsCustomizer.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/remoting/ActionRemoteBehavior.kt b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/remoting/ActionRemoteBehavior.kt index f183e06dac49..0e9eeed5f3e9 100644 --- a/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/remoting/ActionRemoteBehavior.kt +++ b/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/remoting/ActionRemoteBehavior.kt @@ -69,7 +69,7 @@ enum class ActionRemoteBehavior { @ApiStatus.Internal @ApiStatus.Experimental interface ActionRemoteBehaviorSpecification { - fun getBehavior(): ActionRemoteBehavior + fun getBehavior(): ActionRemoteBehavior? interface Frontend : ActionRemoteBehaviorSpecification { override fun getBehavior(): ActionRemoteBehavior = ActionRemoteBehavior.FrontendOnly diff --git a/platform/non-modal-welcome-screen/src/com/intellij/platform/ide/nonModalWelcomeScreen/actions/WelcomeScreenAwareActionsCustomizer.kt b/platform/non-modal-welcome-screen/src/com/intellij/platform/ide/nonModalWelcomeScreen/actions/WelcomeScreenAwareActionsCustomizer.kt index b1883f6d2a5f..19fd32d0c9e9 100644 --- a/platform/non-modal-welcome-screen/src/com/intellij/platform/ide/nonModalWelcomeScreen/actions/WelcomeScreenAwareActionsCustomizer.kt +++ b/platform/non-modal-welcome-screen/src/com/intellij/platform/ide/nonModalWelcomeScreen/actions/WelcomeScreenAwareActionsCustomizer.kt @@ -40,7 +40,7 @@ private fun ActionRuntimeRegistrar.replaceExistingAction( } private fun hideActionOnWelcomeScreen(action: AnAction): AnAction { - return if (action is ActionRemoteBehaviorSpecification) { + return if (action is ActionRemoteBehaviorSpecification && action.getBehavior() != null) { WelcomeScreenHiddenActionWithRemoteSpec(action) } else { @@ -51,7 +51,7 @@ private fun hideActionOnWelcomeScreen(action: AnAction): AnAction { private class WelcomeScreenHiddenActionWithRemoteSpec(val actionWithSpec: T) : WelcomeScreenHiddenAction(actionWithSpec), ActionRemoteBehaviorSpecification where T : AnAction, T : ActionRemoteBehaviorSpecification { - override fun getBehavior(): ActionRemoteBehavior = actionWithSpec.getBehavior() + override fun getBehavior(): ActionRemoteBehavior? = actionWithSpec.getBehavior() } private open class WelcomeScreenHiddenAction(action: AnAction) : AnActionWrapper(action) {