From 2e296ab24a16c060df0a8f9c14acc690278a490e Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Wed, 11 Feb 2026 18:36:33 +0100 Subject: [PATCH] IJPL-207762 drop unused key for custom action id GitOrigin-RevId: a0c865615aff9da89dfef2c4f8504b297dffca12 --- platform/lang-impl/api-dump-unreviewed.txt | 1 - .../completion/CodeCompletionHandlerBase.java | 12 ++---------- .../codeInsight/completion/CompletionPhase.kt | 8 +------- .../completion/CompletionProgressIndicator.java | 8 +------- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/platform/lang-impl/api-dump-unreviewed.txt b/platform/lang-impl/api-dump-unreviewed.txt index 34c745507001..5f42d0616363 100644 --- a/platform/lang-impl/api-dump-unreviewed.txt +++ b/platform/lang-impl/api-dump-unreviewed.txt @@ -1812,7 +1812,6 @@ c:com.intellij.codeInsight.completion.CodeCompletionHandlerBase - p:completionFinished(com.intellij.codeInsight.completion.CompletionProgressIndicator,Z):V - s:createHandler(com.intellij.codeInsight.completion.CompletionType):com.intellij.codeInsight.completion.CodeCompletionHandlerBase - s:createHandler(com.intellij.codeInsight.completion.CompletionType,Z,Z,Z):com.intellij.codeInsight.completion.CodeCompletionHandlerBase -- s:createHandler(com.intellij.codeInsight.completion.CompletionType,Z,Z,Z,java.lang.String):com.intellij.codeInsight.completion.CodeCompletionHandlerBase - handleCompletionElementSelected(com.intellij.codeInsight.lookup.LookupElement,java.util.List,C,com.intellij.codeInsight.completion.OffsetMap,com.intellij.codeInsight.completion.OffsetsInFile,com.intellij.openapi.editor.Editor,I):V - f:invokeCompletion(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Editor):V - f:invokeCompletion(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Editor,I):V diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java index 3f384e5671a2..6408445a4efa 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java @@ -1,4 +1,4 @@ -// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInsight.completion; @@ -111,15 +111,7 @@ public class CodeCompletionHandlerBase { boolean invokedExplicitly, boolean autopopup, boolean synchronous) { - return createHandler(completionType, invokedExplicitly, autopopup, synchronous, IdeActions.ACTION_CODE_COMPLETION); - } - - public static @NotNull CodeCompletionHandlerBase createHandler(@NotNull CompletionType completionType, - boolean invokedExplicitly, - boolean autopopup, - boolean synchronous, - @NotNull String actionId) { - AnAction codeCompletionAction = ActionManager.getInstance().getAction(actionId); + AnAction codeCompletionAction = ActionManager.getInstance().getAction(IdeActions.ACTION_CODE_COMPLETION); if (codeCompletionAction instanceof OverridingAction) { codeCompletionAction = ((ActionManagerImpl)ActionManager.getInstance()).getBaseAction((OverridingAction)codeCompletionAction); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt index f24752f438a9..d18da27bad73 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt @@ -11,7 +11,6 @@ import com.intellij.codeInsight.completion.impl.CompletionServiceImpl.Companion. import com.intellij.codeWithMe.ClientId import com.intellij.codeWithMe.ClientId.Companion.withExplicitClientId import com.intellij.openapi.Disposable -import com.intellij.openapi.actionSystem.IdeActions import com.intellij.openapi.application.ApplicationListener import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.ModalityState @@ -316,8 +315,7 @@ sealed class CompletionPhase @ApiStatus.Internal constructor( phase.requestCompleted() val time = phase.indicator?.invocationCount ?: 0 - val customId = completionEditor.getUserData(CUSTOM_CODE_COMPLETION_ACTION_ID) ?: IdeActions.ACTION_CODE_COMPLETION - val handler = CodeCompletionHandlerBase.createHandler(completionType, false, autopopup, false, customId) + val handler = CodeCompletionHandlerBase.createHandler(completionType, false, autopopup, false) handler.invokeCompletion(project, completionEditor, time, false) } @@ -559,10 +557,6 @@ sealed class CompletionPhase @ApiStatus.Internal constructor( @JvmField internal val AUTO_POPUP_TYPED_EVENT: Key = Key.create("AutoPopupTypedEvent") - @ApiStatus.Internal - @JvmField - val CUSTOM_CODE_COMPLETION_ACTION_ID: Key = Key.create("CodeCompletionActionID") - @JvmField val NoCompletion: CompletionPhase = NoCompletionImpl } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java index 3d41c6126739..cda97c90c572 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java @@ -92,8 +92,6 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import static com.intellij.codeInsight.completion.CompletionPhase.CUSTOM_CODE_COMPLETION_ACTION_ID; - /** * See cancellation logic in {@link CompletionPhase.BgCalculation#restartOnWriteAction)} * @@ -910,11 +908,7 @@ public final class CompletionProgressIndicator extends ProgressIndicatorBase imp if (handler.isTestingMode() && !TestModeFlags.is(CompletionAutoPopupHandler.ourTestingAutopopup)) { closeAndFinish(false); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); - String customId = myEditor.getUserData(CUSTOM_CODE_COMPLETION_ACTION_ID); - if (customId == null) { - customId = IdeActions.ACTION_CODE_COMPLETION; - } - CodeCompletionHandlerBase handler = CodeCompletionHandlerBase.createHandler(myCompletionType, false, false, true, customId); + CodeCompletionHandlerBase handler = CodeCompletionHandlerBase.createHandler(myCompletionType, false, false, true); handler.invokeCompletion(getProject(), myEditor, myInvocationCount); return; }