mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-178462 Parameter info in tooltip for @Deprecated method
This commit is contained in:
+1
-1
@@ -630,7 +630,7 @@ public class MethodParameterInfoHandler implements ParameterInfoHandlerWithTabAc
|
||||
highlightStartOffset,
|
||||
highlightEndOffset,
|
||||
!context.isUIComponentEnabled(),
|
||||
method.isDeprecated() && !context.isSingleParameterInfo(),
|
||||
method.isDeprecated() && !context.isSingleParameterInfo() && !context.isSingleOverload(),
|
||||
false,
|
||||
context.getDefaultParameterColor()
|
||||
);
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.codeInsight.hint.api.impls.AnnotationParameterInfoHandler;
|
||||
import com.intellij.codeInsight.hint.api.impls.MethodParameterInfoHandler;
|
||||
import com.intellij.codeInsight.lookup.LookupElement;
|
||||
import com.intellij.codeInsight.lookup.LookupElementPresentation;
|
||||
import com.intellij.ide.highlighter.JavaFileType;
|
||||
import com.intellij.lang.parameterInfo.CreateParameterInfoContext;
|
||||
import com.intellij.lang.parameterInfo.ParameterInfoUIContextEx;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
@@ -296,6 +297,11 @@ public class ParameterInfoTest extends LightCodeInsightFixtureTestCase {
|
||||
checkHighlighted(0);
|
||||
}
|
||||
|
||||
public void testNoStrikeoutForSingleDeprecatedMethod() {
|
||||
myFixture.configureByText(JavaFileType.INSTANCE, "class C { void m() { System.runFinalizersOnExit(true<caret>); } }");
|
||||
assertEquals("<html>boolean value</html>", parameterPresentation(-1));
|
||||
}
|
||||
|
||||
private void checkHighlighted(int lineIndex) {
|
||||
MethodParameterInfoHandler handler = new MethodParameterInfoHandler();
|
||||
CreateParameterInfoContext context = createContext();
|
||||
|
||||
@@ -29,6 +29,7 @@ public interface ParameterInfoUIContext {
|
||||
int getCurrentParameterIndex();
|
||||
PsiElement getParameterOwner();
|
||||
|
||||
boolean isSingleOverload();
|
||||
boolean isSingleParameterInfo();
|
||||
Color getDefaultParameterColor();
|
||||
}
|
||||
|
||||
@@ -210,6 +210,11 @@ public class ParameterInfoComponent extends JPanel {
|
||||
return myParameterOwner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleOverload() {
|
||||
return myPanels.length == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleParameterInfo() {
|
||||
return mySingleParameterInfo;
|
||||
|
||||
+5
@@ -69,6 +69,11 @@ public class MockParameterInfoUIContext<T extends PsiElement> implements Paramet
|
||||
return myFunction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleOverload() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleParameterInfo() {
|
||||
return false;
|
||||
|
||||
@@ -819,6 +819,11 @@ public class PyParameterInfoTest extends LightMarkedTestCase {
|
||||
return myParameterOwner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleOverload() {
|
||||
return myItemsToShow.length == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleParameterInfo() {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user