don't show overload switch prompt for lookup hint

This commit is contained in:
Dmitry Batrak
2017-09-26 17:58:52 +03:00
parent c36c5d8b49
commit 12db31ac2d
3 changed files with 8 additions and 8 deletions
@@ -91,10 +91,11 @@ public class ParameterInfoComponent extends JPanel {
}
ParameterInfoComponent(Object[] objects, Editor editor, @NotNull ParameterInfoHandler handler) {
this(objects, editor, handler, false);
this(objects, editor, handler, false, false);
}
ParameterInfoComponent(Object[] objects, Editor editor, @NotNull ParameterInfoHandler handler, boolean requestFocus) {
ParameterInfoComponent(Object[] objects, Editor editor, @NotNull ParameterInfoHandler handler,
boolean requestFocus, boolean allowSwitchLabel) {
super(new BorderLayout());
myRequestFocus = requestFocus;
@@ -131,7 +132,8 @@ public class ParameterInfoComponent extends JPanel {
String upShortcut = KeymapUtil.getFirstKeyboardShortcutText(IdeActions.ACTION_METHOD_OVERLOAD_SWITCH_UP);
String downShortcut = KeymapUtil.getFirstKeyboardShortcutText(IdeActions.ACTION_METHOD_OVERLOAD_SWITCH_DOWN);
if (upShortcut.isEmpty() && downShortcut.isEmpty()) {
if (!allowSwitchLabel || myObjects.length <= 1 || !myHandler.supportsOverloadSwitching() ||
upShortcut.isEmpty() && downShortcut.isEmpty()) {
myShortcutLabel = null;
}
else {
@@ -277,9 +279,7 @@ public class ParameterInfoComponent extends JPanel {
}
}
if (myShortcutLabel != null) {
myShortcutLabel.setVisible(!singleParameterInfo && myObjects.length > 1 && myHandler.supportsOverloadSwitching());
}
if (myShortcutLabel != null) myShortcutLabel.setVisible(!singleParameterInfo);
invalidate();
validate();
@@ -149,7 +149,7 @@ public class ParameterInfoController implements Disposable {
myHandler = handler;
myProvider = new MyBestLocationPointProvider(editor);
myLbraceMarker = editor.getDocument().createRangeMarker(lbraceOffset, lbraceOffset);
myComponent = new ParameterInfoComponent(descriptors, editor, handler, requestFocus);
myComponent = new ParameterInfoComponent(descriptors, editor, handler, requestFocus, true);
myHint = new LightweightHint(myComponent);
myKeepOnHintHidden = !showHint;
mySingleParameterInfo = !showHint;
@@ -143,7 +143,7 @@ public class ShowParameterInfoHandler implements CodeInsightActionHandler {
final Project project,
ParameterInfoHandler handler,
boolean requestFocus) {
ParameterInfoComponent component = new ParameterInfoComponent(descriptors, editor, handler, requestFocus);
ParameterInfoComponent component = new ParameterInfoComponent(descriptors, editor, handler, requestFocus, false);
component.update(false);
final LightweightHint hint = new LightweightHint(component);