diff --git a/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java b/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java index 84ca42060306..07f430cb39b1 100644 --- a/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/hint/api/impls/MethodParameterInfoHandler.java @@ -275,12 +275,6 @@ public class MethodParameterInfoHandler implements ParameterInfoHandlerWithTabAc @Override public void updateParameterInfo(@NotNull final PsiExpressionList o, @NotNull final UpdateParameterInfoContext context) { - PsiElement parameterOwner = context.getParameterOwner(); - if (parameterOwner != o) { - context.removeHint(); - return; - } - int offset = context.getOffset(); TextRange elRange = o.getTextRange(); int index = offset <= elRange.getStartOffset() || offset >= elRange.getEndOffset() diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/ParameterInfoTest.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/ParameterInfoTest.java index 816eac10410e..14c4ab2051d2 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/ParameterInfoTest.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/ParameterInfoTest.java @@ -502,7 +502,7 @@ public class ParameterInfoTest extends AbstractParameterInfoTestCase { public void testCustomHandlerHighlighterWithEscaping() { myFixture.configureByText(PlainTextFileType.INSTANCE, " "); - LanguageParameterInfo.INSTANCE.addExplicitExtension(PlainTextLanguage.INSTANCE, new ParameterInfoHandler() { + LanguageParameterInfo.INSTANCE.addExplicitExtension(PlainTextLanguage.INSTANCE, new ParameterInfoHandler() { @Override public boolean couldShowInLookup() { return false; @@ -516,24 +516,24 @@ public class ParameterInfoTest extends AbstractParameterInfoTestCase { @NotNull @Override - public Object findElementForParameterInfo(@NotNull CreateParameterInfoContext context) { + public PsiElement findElementForParameterInfo(@NotNull CreateParameterInfoContext context) { context.setItemsToShow(new Object[]{this}); - return this; + return context.getFile(); } @Override - public void showParameterInfo(@NotNull Object element, @NotNull CreateParameterInfoContext context) { + public void showParameterInfo(@NotNull PsiElement element, @NotNull CreateParameterInfoContext context) { context.showHint(context.getFile(), context.getOffset(), this); } @NotNull @Override - public Object findElementForUpdatingParameterInfo(@NotNull UpdateParameterInfoContext context) { - return this; + public PsiElement findElementForUpdatingParameterInfo(@NotNull UpdateParameterInfoContext context) { + return context.getFile(); } @Override - public void updateParameterInfo(@NotNull Object o, @NotNull UpdateParameterInfoContext context) {} + public void updateParameterInfo(@NotNull PsiElement o, @NotNull UpdateParameterInfoContext context) {} @Override public void updateUI(Object p, @NotNull ParameterInfoUIContext context) { diff --git a/platform/lang-api/src/com/intellij/lang/parameterInfo/ParameterInfoHandler.java b/platform/lang-api/src/com/intellij/lang/parameterInfo/ParameterInfoHandler.java index b71a05f7c224..69dadfa0b03d 100644 --- a/platform/lang-api/src/com/intellij/lang/parameterInfo/ParameterInfoHandler.java +++ b/platform/lang-api/src/com/intellij/lang/parameterInfo/ParameterInfoHandler.java @@ -15,14 +15,21 @@ package com.intellij.lang.parameterInfo; import com.intellij.codeInsight.lookup.LookupElement; +import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -public interface ParameterInfoHandler { +import java.awt.*; + +public interface ParameterInfoHandler { boolean couldShowInLookup(); @Nullable Object[] getParametersForLookup(LookupElement item, ParameterInfoContext context); - // Find element for parameter info should also set ItemsToShow in context and may set highlighted element + /** + * Find psiElement for parameter info should also set ItemsToShow in context and may set highlighted element + * + * Note: it is executed on non UI thread + */ @Nullable ParameterOwner findElementForParameterInfo(@NotNull CreateParameterInfoContext context); // Usually context.showHint @@ -31,9 +38,25 @@ public interface ParameterInfoHandler { // Null returns leads to removing hint @Nullable ParameterOwner findElementForUpdatingParameterInfo(@NotNull UpdateParameterInfoContext context); + + /** + *

Updates parameter info context due to change of caret position.

+ * + *

It could update context and state of {@link UpdateParameterInfoContext#getObjectsToView()}

+ * + *

Note: context.getParameterOwner() equals to parameterOwner or null

+ * + *

Note: it is executed on non UI thread.

+ */ void updateParameterInfo(@NotNull final ParameterOwner parameterOwner, @NotNull UpdateParameterInfoContext context); - // context.setEnabled / context.setupUIComponentPresentation + /** + *

This method is executed on UI thread and supposed only to update UI representation using + * {@link ParameterInfoUIContext#setUIComponentEnabled(boolean)} or {@link ParameterInfoUIContext#setupUIComponentPresentation(String, int, int, boolean, boolean, boolean, Color)}.

+ * + *

Don't perform any heavy calculations like resolve here: move it to {@link #findElementForParameterInfo(CreateParameterInfoContext)} or + * {@link #updateParameterInfo(Object, UpdateParameterInfoContext)}.

+ */ void updateUI(ParameterType p, @NotNull ParameterInfoUIContext context); default boolean supportsOverloadSwitching() { return false; } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupControllerImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupControllerImpl.java index 7cf89fb15ae3..93a6328cb897 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupControllerImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupControllerImpl.java @@ -136,7 +136,8 @@ public class AutoPopupControllerImpl extends AutoPopupController { try { PsiFile file1 = PsiDocumentManager.getInstance(myProject).getPsiFile(editor.getDocument()); if (file1 != null) { - ShowParameterInfoHandler.invoke(myProject, editor, file1, lbraceOffset, highlightedMethod, false, true); + ShowParameterInfoHandler.invoke(myProject, editor, file1, lbraceOffset, highlightedMethod, false, + true, CodeInsightBundle.message("auto.popup.progress.title"), e -> { }); } } catch (IndexNotReadyException ignored) { //anything can happen on alarm diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoController.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoController.java index a9cc846d88dd..5fb874af2003 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoController.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoController.java @@ -3,6 +3,7 @@ package com.intellij.codeInsight.hint; import com.intellij.codeInsight.AutoPopupController; +import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.codeInsight.CodeInsightSettings; import com.intellij.codeInsight.daemon.impl.ParameterHintsPresentationManager; import com.intellij.codeInsight.lookup.Lookup; @@ -14,11 +15,15 @@ import com.intellij.lang.parameterInfo.*; import com.intellij.openapi.Disposable; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; +import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.command.undo.UndoManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.*; import com.intellij.openapi.editor.event.*; import com.intellij.openapi.editor.ex.util.EditorUtil; +import com.intellij.openapi.progress.ProgressIndicator; +import com.intellij.openapi.progress.ProgressManager; +import com.intellij.openapi.progress.Task; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.IndexNotReadyException; import com.intellij.openapi.project.Project; @@ -26,6 +31,7 @@ import com.intellij.openapi.ui.popup.Balloon.Position; import com.intellij.openapi.util.*; import com.intellij.openapi.util.registry.Registry; import com.intellij.openapi.util.text.StringUtil; +import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; @@ -50,6 +56,7 @@ import java.awt.*; import java.beans.PropertyChangeListener; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.locks.LockSupport; @@ -66,7 +73,7 @@ public class ParameterInfoController extends UserDataHolderBase implements Visib private boolean myKeepOnHintHidden; private final CaretListener myEditorCaretListener; - @NotNull private final ParameterInfoHandler myHandler; + @NotNull private final ParameterInfoHandler myHandler; private final MyBestLocationPointProvider myProvider; private final ParameterInfoListener[] myListeners; @@ -181,11 +188,11 @@ public class ParameterInfoController extends UserDataHolderBase implements Visib LookupManager.getInstance(project).addPropertyChangeListener(lookupListener, this); EditorUtil.disposeWithEditor(myEditor, this); - myComponent.update(mySingleParameterInfo); // to have correct preferred size if (showHint) { showHint(requestFocus, mySingleParameterInfo); + } else { + updateComponent(); } - updateComponent(); } void setDescriptors(Object[] descriptors) { @@ -309,44 +316,43 @@ public class ParameterInfoController extends UserDataHolderBase implements Visib } final PsiFile file = PsiUtilBase.getPsiFileInEditor(myEditor, myProject); - CharSequence chars = myEditor.getDocument().getCharsSequence(); int caretOffset = myEditor.getCaretModel().getOffset(); - final int offset = myHandler.isWhitespaceSensitive() ? caretOffset : - CharArrayUtil.shiftBackward(chars, caretOffset - 1, WHITESPACE) + 1; + final int offset = getCurrentOffset(); final UpdateParameterInfoContext context = new MyUpdateParameterInfoContext(offset, file); - final Object elementForUpdating = myHandler.findElementForUpdatingParameterInfo(context); + final PsiElement elementForUpdating = myHandler.findElementForUpdatingParameterInfo(context); if (elementForUpdating != null) { - myHandler.updateParameterInfo(elementForUpdating, context); - boolean knownParameter = (myComponent.getObjects().length == 1 || myComponent.getHighlighted() != null) && - myComponent.getCurrentParameterIndex() != -1; - if (mySingleParameterInfo && !knownParameter && myHint.isVisible()) { - hideHint(); - } - if (myKeepOnHintHidden && knownParameter && !myHint.isVisible()) { - AutoPopupController.getInstance(myProject).autoPopupParameterInfo(myEditor, null); - } - if (!myDisposed && (myHint.isVisible() && !myEditor.isDisposed() && - (myEditor.getComponent().getRootPane() != null || ApplicationManager.getApplication().isUnitTestMode()) || - ApplicationManager.getApplication().isHeadlessEnvironment())) { - Model result = myComponent.update(mySingleParameterInfo); - result.project = myProject; - result.range = myComponent.getParameterOwner().getTextRange(); - result.editor = myEditor; - for (ParameterInfoListener listener : myListeners) { - listener.hintUpdated(result); + executeUpdateParameterInfo(elementForUpdating, context, () -> { + boolean knownParameter = (myComponent.getObjects().length == 1 || myComponent.getHighlighted() != null) && + myComponent.getCurrentParameterIndex() != -1; + if (mySingleParameterInfo && !knownParameter && myHint.isVisible()) { + hideHint(); } - if (ApplicationManager.getApplication().isHeadlessEnvironment()) return; - IdeTooltip tooltip = myHint.getCurrentIdeTooltip(); - short position = tooltip != null - ? toShort(tooltip.getPreferredPosition()) - : HintManager.ABOVE; - Pair pos = myProvider.getBestPointPosition( - myHint, elementForUpdating instanceof PsiElement ? (PsiElement)elementForUpdating : null, - caretOffset, myEditor.getCaretModel().getVisualPosition(), position); - HintManagerImpl.adjustEditorHintPosition(myHint, myEditor, pos.getFirst(), pos.getSecond()); - } + if (myKeepOnHintHidden && knownParameter && !myHint.isVisible()) { + AutoPopupController.getInstance(myProject).autoPopupParameterInfo(myEditor, null); + } + if (!myDisposed && (myHint.isVisible() && !myEditor.isDisposed() && + (myEditor.getComponent().getRootPane() != null || ApplicationManager.getApplication().isUnitTestMode()) || + ApplicationManager.getApplication().isHeadlessEnvironment())) { + Model result = myComponent.update(mySingleParameterInfo); + result.project = myProject; + result.range = myComponent.getParameterOwner().getTextRange(); + result.editor = myEditor; + for (ParameterInfoListener listener : myListeners) { + listener.hintUpdated(result); + } + if (ApplicationManager.getApplication().isHeadlessEnvironment()) return; + IdeTooltip tooltip = myHint.getCurrentIdeTooltip(); + short position = tooltip != null + ? toShort(tooltip.getPreferredPosition()) + : HintManager.ABOVE; + Pair pos = myProvider.getBestPointPosition( + myHint, elementForUpdating instanceof PsiElement ? (PsiElement)elementForUpdating : null, + caretOffset, myEditor.getCaretModel().getVisualPosition(), position); + HintManagerImpl.adjustEditorHintPosition(myHint, myEditor, pos.getFirst(), pos.getSecond()); + } + }); } else { hideHint(); @@ -356,6 +362,51 @@ public class ParameterInfoController extends UserDataHolderBase implements Visib } } + private int getCurrentOffset() { + int caretOffset = myEditor.getCaretModel().getOffset(); + CharSequence chars = myEditor.getDocument().getCharsSequence(); + return myHandler.isWhitespaceSensitive() ? caretOffset : + CharArrayUtil.shiftBackward(chars, caretOffset - 1, WHITESPACE) + 1; + } + + private void executeUpdateParameterInfo(@NotNull PsiElement elementForUpdating, UpdateParameterInfoContext context, Runnable continuation) { + PsiElement parameterOwner = context.getParameterOwner(); + if (parameterOwner != null && !parameterOwner.equals(elementForUpdating)) { + context.removeHint(); + return; + } + + final Component focusOwner = IdeFocusManager.getInstance(myProject).getFocusOwner(); + ProgressManager.getInstance().run( + new Task.Backgroundable(myProject, CodeInsightBundle.message("parameter.info.progress.title"), true) { + @Override + public void run(@NotNull ProgressIndicator indicator) { + ReadAction + .nonBlocking(() -> { + try { + myHandler.updateParameterInfo(elementForUpdating, context); + } + catch (IndexNotReadyException e) { + DumbService.getInstance(myProject) + .showDumbModeNotification(CodeInsightBundle.message("parameter.info.indexing.mode.not.supported")); + } + }) + .cancelWith(indicator) + .expireWhen(() -> getCurrentOffset() != context.getOffset() || !elementForUpdating.isValid()) + .executeSynchronously(); + + if (continuation != null && !indicator.isCanceled()) { + ApplicationManager.getApplication().invokeLater(() -> { + if (!elementForUpdating.isValid() || getCurrentOffset() != context.getOffset() || + !Objects.equals(focusOwner, IdeFocusManager.getInstance(myProject).getFocusOwner())) return; + + continuation.run(); + }); + } + } + }); + } + @HintManager.PositionFlags private static short toShort(Position position) { switch (position) { @@ -395,7 +446,7 @@ public class ParameterInfoController extends UserDataHolderBase implements Visib myEditor.getScrollingModel().scrollToCaret(ScrollType.RELATIVE); myEditor.getSelectionModel().removeSelection(); if (argsList != null) { - myHandler.updateParameterInfo(argsList, new MyUpdateParameterInfoContext(offset, file)); + executeUpdateParameterInfo(argsList, new MyUpdateParameterInfoContext(offset, file), null); } } @@ -634,8 +685,12 @@ public class ParameterInfoController extends UserDataHolderBase implements Visib @Override public void removeHint() { - hideHint(); - if (!myKeepOnHintHidden) Disposer.dispose(ParameterInfoController.this); + ApplicationManager.getApplication().invokeLater(() -> { + if (!myHint.isVisible()) return; + + hideHint(); + if (!myKeepOnHintHidden) Disposer.dispose(ParameterInfoController.this); + }); } @Override diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ShowParameterInfoHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ShowParameterInfoHandler.java index 75534b884260..432bcfafffa2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ShowParameterInfoHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ShowParameterInfoHandler.java @@ -3,6 +3,7 @@ package com.intellij.codeInsight.hint; import com.intellij.codeInsight.CodeInsightActionHandler; +import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.codeInsight.lookup.Lookup; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupManager; @@ -10,23 +11,33 @@ import com.intellij.lang.Language; import com.intellij.lang.parameterInfo.LanguageParameterInfo; import com.intellij.lang.parameterInfo.ParameterInfoHandler; import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.application.ReadAction; import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.progress.ProgressIndicator; +import com.intellij.openapi.progress.ProgressManager; +import com.intellij.openapi.progress.Task; import com.intellij.openapi.project.DumbService; +import com.intellij.openapi.project.IndexNotReadyException; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Pair; +import com.intellij.openapi.wm.IdeFocusManager; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.util.PsiUtilCore; import com.intellij.ui.LightweightHint; +import com.intellij.util.Consumer; +import com.intellij.util.ObjectUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.awt.*; import java.util.LinkedHashSet; +import java.util.Objects; import java.util.Set; public class ShowParameterInfoHandler implements CodeInsightActionHandler { + private static final ParameterInfoHandler[] EMPTY_HANDLERS = new ParameterInfoHandler[0]; private final boolean myRequestFocus; public ShowParameterInfoHandler() { @@ -57,11 +68,17 @@ public class ShowParameterInfoHandler implements CodeInsightActionHandler { public static void invoke(final Project project, final Editor editor, PsiFile file, int lbraceOffset, PsiElement highlightedElement, boolean requestFocus) { - invoke(project, editor, file, lbraceOffset, highlightedElement, requestFocus, false); + invoke(project, editor, file, lbraceOffset, highlightedElement, requestFocus, false, + CodeInsightBundle.message("parameter.info.progress.title"), + e -> DumbService.getInstance(project) + .showDumbModeNotification(CodeInsightBundle.message("parameter.info.indexing.mode.not.supported"))); } public static void invoke(final Project project, final Editor editor, PsiFile file, - int lbraceOffset, PsiElement highlightedElement, boolean requestFocus, boolean singleParameterHint) { + int lbraceOffset, PsiElement highlightedElement, + boolean requestFocus, boolean singleParameterHint, + String progressTitle, + Consumer indexNotReadyExceptionConsumer) { ApplicationManager.getApplication().assertIsDispatchThread(); PsiDocumentManager.getInstance(project).commitAllDocuments(); @@ -85,8 +102,9 @@ public class ShowParameterInfoHandler implements CodeInsightActionHandler { // file.findElementAt(file.getTextLength()) returns null but we may need to show parameter info at EOF offset (for example in SQL) final int offsetForLangDetection = offset > 0 && offset == fileLength ? offset - 1 : offset; final Language language = PsiUtilCore.getLanguageAtOffset(file, offsetForLangDetection); - ParameterInfoHandler[] handlers = getHandlers(project, language, file.getViewProvider().getBaseLanguage()); - if (handlers == null) handlers = new ParameterInfoHandler[0]; + + final ParameterInfoHandler[] handlers = + ObjectUtils.notNull(getHandlers(project, language, file.getViewProvider().getBaseLanguage()), EMPTY_HANDLERS); Lookup lookup = LookupManager.getInstance(project).getActiveLookup(); @@ -94,7 +112,7 @@ public class ShowParameterInfoHandler implements CodeInsightActionHandler { LookupElement item = lookup.getCurrentItem(); if (item != null) { - for(ParameterInfoHandler handler:handlers) { + for (ParameterInfoHandler handler : handlers) { if (handler.couldShowInLookup()) { final Object[] items = handler.getParametersForLookup(item, context); if (items != null && items.length > 0) { @@ -107,19 +125,60 @@ public class ShowParameterInfoHandler implements CodeInsightActionHandler { return; } - DumbService.getInstance(project).setAlternativeResolveEnabled(true); - try { - for (ParameterInfoHandler handler : handlers) { - Object element = handler.findElementForParameterInfo(context); - if (element != null) { - handler.showParameterInfo(element, context); - break; + final Component focusOwner = IdeFocusManager.getInstance(project).getFocusOwner(); + + ProgressManager.getInstance().run( + new Task.Backgroundable(project, progressTitle, true) { + @Override + public void run(@NotNull ProgressIndicator indicator) { + PsiElement element = null; + ParameterInfoHandler handler = null; + + DumbService dumbService = DumbService.getInstance(project); + dumbService.setAlternativeResolveEnabled(true); + + try { + for (int i = 0; i < handlers.length; i++) { + final ParameterInfoHandler h = handlers[i]; + handler = h; + element = ReadAction + .nonBlocking(() -> { + try { + return h.findElementForParameterInfo(context); + } + catch (IndexNotReadyException e) { + indexNotReadyExceptionConsumer.consume(e); + return null; + } + }) + .cancelWith(indicator) + .expireWhen(() -> editor.getCaretModel().getOffset() != offset) + .executeSynchronously(); + + if (element != null) { + break; + } + } + } + finally { + dumbService.setAlternativeResolveEnabled(false); + } + + if (element != null && !indicator.isCanceled()) { + final PsiElement el = element; + final ParameterInfoHandler h = handler; + ApplicationManager.getApplication().invokeLater(() -> { + if (!el.isValid()) return; + + if (editor.getCaretModel().getOffset() != context.getOffset() || + !Objects.equals(focusOwner, IdeFocusManager.getInstance(project).getFocusOwner())) return; + + h.showParameterInfo(el, context); + }); + } } } - } - finally { - DumbService.getInstance(project).setAlternativeResolveEnabled(false); - } + ); } private static void showLookupEditorHint(Object[] descriptors, diff --git a/platform/platform-resources-en/src/messages/CodeInsightBundle.properties b/platform/platform-resources-en/src/messages/CodeInsightBundle.properties index eba59f29c100..46e9d5494c6f 100644 --- a/platform/platform-resources-en/src/messages/CodeInsightBundle.properties +++ b/platform/platform-resources-en/src/messages/CodeInsightBundle.properties @@ -592,4 +592,9 @@ collapse.selection.overlapping.warning.cancel=Cancel change.uid.action.name=Randomly change 'serialVersionUID' initializer -intention.convert.to.single.return.name=Transform body to single exit-point form \ No newline at end of file +intention.convert.to.single.return.name=Transform body to single exit-point form + +parameter.info.progress.title=Calculating parameter info... +parameter.info.indexing.mode.not.supported=Parameter Info is unavailable during indexing + +auto.popup.progress.title=Calculating auto popup info... \ No newline at end of file diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java index 938b17531534..e9da774a4a73 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java @@ -185,12 +185,6 @@ public class GroovyParameterInfoHandler implements ParameterInfoHandlerWithTabAc @Override public void updateParameterInfo(@NotNull GroovyPsiElement place, @NotNull UpdateParameterInfoContext context) { - final PsiElement parameterOwner = context.getParameterOwner(); - if (parameterOwner != place) { - context.removeHint(); - return; - } - int offset = context.getEditor().getCaretModel().getOffset(); offset = CharArrayUtil.shiftForward(context.getEditor().getDocument().getText(), offset, " \t\n"); final int currIndex = getCurrentParameterIndex(place, offset); diff --git a/python/src/com/jetbrains/python/PyParameterInfoHandler.java b/python/src/com/jetbrains/python/PyParameterInfoHandler.java index 158532d6e9be..21fd5af197d2 100644 --- a/python/src/com/jetbrains/python/PyParameterInfoHandler.java +++ b/python/src/com/jetbrains/python/PyParameterInfoHandler.java @@ -101,11 +101,6 @@ public class PyParameterInfoHandler implements ParameterInfoHandler flattenedArguments = PyUtil.flattenedParensAndLists(argumentList.getArguments()); final int allegedCursorOffset = context.getOffset(); // this is already shifted backwards to skip spaces diff --git a/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java b/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java index 44a777696bec..ece718b36d44 100644 --- a/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java +++ b/xml/impl/src/com/intellij/codeInsight/hint/api/impls/XmlParameterInfoHandler.java @@ -92,11 +92,7 @@ public class XmlParameterInfoHandler implements ParameterInfoHandler