From 61471dd8751e9e614ea76f902e8107b34fd5de9e Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Tue, 10 Feb 2026 17:55:20 +0100 Subject: [PATCH] IJPL-207762 cleanup AutoPopupController API GitOrigin-RevId: 684fdec3020d6586e2e137ffe6f275640875147b --- .../analysis-impl/api-dump-unreviewed.txt | 3 --- .../codeInsight/AutoPopupController.java | 20 ++++++++++++++++--- .../codeInsight/AutoPopupControllerImpl.java | 4 ++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/platform/analysis-impl/api-dump-unreviewed.txt b/platform/analysis-impl/api-dump-unreviewed.txt index be45290ca5b0..02d51d828f27 100644 --- a/platform/analysis-impl/api-dump-unreviewed.txt +++ b/platform/analysis-impl/api-dump-unreviewed.txt @@ -88,14 +88,11 @@ a:com.intellij.codeInsight.AutoPopupController - sf:AUTO_POPUP_ON_FOCUS_GAINED:com.intellij.openapi.util.Key - sf:NO_ADS:com.intellij.openapi.util.Key - sf:SHOW_BOTTOM_PANEL_IN_LOOKUP_UI:com.intellij.openapi.util.Key -- ():V - a:autoPopupMemberLookup(com.intellij.openapi.editor.Editor,com.intellij.codeInsight.completion.CompletionType,com.intellij.openapi.util.Condition):V - a:autoPopupMemberLookup(com.intellij.openapi.editor.Editor,com.intellij.openapi.util.Condition):V - a:autoPopupParameterInfo(com.intellij.openapi.editor.Editor,com.intellij.psi.PsiElement):V -- a:cancelAllRequests():V - s:getInstance(com.intellij.openapi.project.Project):com.intellij.codeInsight.AutoPopupController - a:scheduleAutoPopup(com.intellij.openapi.editor.Editor,com.intellij.codeInsight.completion.CompletionType,com.intellij.openapi.util.Condition):V -- a:waitForDelayedActions(J,java.util.concurrent.TimeUnit):V a:com.intellij.codeInsight.TargetElementEvaluatorEx2 - com.intellij.codeInsight.TargetElementEvaluator - ():V diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/AutoPopupController.java b/platform/analysis-impl/src/com/intellij/codeInsight/AutoPopupController.java index fd7f31910ca8..20df04ce9566 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/AutoPopupController.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/AutoPopupController.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; @@ -10,6 +10,7 @@ import com.intellij.openapi.util.Key; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.util.concurrency.annotations.RequiresEdt; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; @@ -106,13 +107,26 @@ public abstract class AutoPopupController { @NotNull CompletionType completionType, @Nullable Condition condition); + /** + * Show the parameter info popup at the given element. + * + * @param editor editor to show the popup in + * @param highlightedElement element to show the popup at + */ + public abstract void autoPopupParameterInfo(@NotNull Editor editor, @Nullable PsiElement highlightedElement); + + @ApiStatus.Internal public abstract void cancelAllRequests(); - public abstract void autoPopupParameterInfo(@NotNull Editor editor, @Nullable PsiElement highlightedMethod); - + /** Use {@link com.intellij.testFramework.AutoPopupParameterInfoTestUtil#waitForAutoPopup} instead */ + @ApiStatus.Internal @TestOnly public abstract void waitForDelayedActions(long timeout, @NotNull TimeUnit unit) throws TimeoutException; + @ApiStatus.Internal + protected AutoPopupController() { + } + //region Deprecated methods /** diff --git a/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupControllerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupControllerImpl.java index 93cb5a126c9d..bcbc9de7e1cd 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupControllerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupControllerImpl.java @@ -152,7 +152,7 @@ class AutoPopupControllerImpl extends AutoPopupController { } @Override - public void autoPopupParameterInfo(@NotNull Editor editor, @Nullable PsiElement highlightedMethod) { + public void autoPopupParameterInfo(@NotNull Editor editor, @Nullable PsiElement highlightedElement) { if (PowerSaveMode.isEnabled()) return; ThreadingAssertions.assertEventDispatchThread(); @@ -179,7 +179,7 @@ class AutoPopupControllerImpl extends AutoPopupController { try { PsiFile file1 = PsiDocumentManager.getInstance(myProject).getPsiFile(editor.getDocument()); if (file1 != null) { - ShowParameterInfoHandler.invoke(myProject, editor, file1, lbraceOffset, highlightedMethod, false, + ShowParameterInfoHandler.invoke(myProject, editor, file1, lbraceOffset, highlightedElement, false, true, null); } }