mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
parameter info: current method preselection when there are varargs overloading (IDEA-168649)
This commit is contained in:
@@ -245,7 +245,7 @@ public class MethodParameterInfoHandler implements ParameterInfoHandlerWithTabAc
|
||||
PsiType parmType = parm.getType();
|
||||
PsiType argType = arg.getType();
|
||||
if (argType == null) continue;
|
||||
if (parmType instanceof PsiEllipsisType && parmType.getArrayDimensions() == argType.getArrayDimensions() + 1) {
|
||||
if (parmType instanceof PsiEllipsisType ) {
|
||||
parmType = ((PsiEllipsisType)parmType).getComponentType();
|
||||
}
|
||||
parmType = substitutor.substitute(parmType);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
class Main {
|
||||
static <T> void of(T t) {}
|
||||
static <T> void of(T... t) {}
|
||||
|
||||
void foo(String... strs){
|
||||
Main.of(st<caret>rs);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Main {
|
||||
static <T> void of(T t) {}
|
||||
static <T> void of(T... t) {}
|
||||
|
||||
void foo(String[] strs){
|
||||
Main.of(st<caret>rs);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Main {
|
||||
static <T> void of(T t) {}
|
||||
static <T> void of(T... t) {}
|
||||
|
||||
void foo(){
|
||||
Main.of("<caret>", "");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Main {
|
||||
static <T> void of(T t) {}
|
||||
static <T> void of(T... t) {}
|
||||
|
||||
void foo(){
|
||||
Main.of("<caret>");
|
||||
}
|
||||
}
|
||||
@@ -76,6 +76,26 @@ public class ParameterInfoTest extends LightCodeInsightFixtureTestCase {
|
||||
}
|
||||
|
||||
public void testSelectionWithGenerics() {
|
||||
doTest2CandidatesWithPreselection();
|
||||
}
|
||||
|
||||
public void testOverloadWithVarargs() {
|
||||
doTest2CandidatesWithPreselection();
|
||||
}
|
||||
|
||||
public void testOverloadWithVarargsMultipleArgs() {
|
||||
doTest2CandidatesWithPreselection();
|
||||
}
|
||||
|
||||
public void testOverloadWithVarargsSingleArg() {
|
||||
doTest2CandidatesWithPreselection();
|
||||
}
|
||||
|
||||
public void testOverloadWithVarargsArray() {
|
||||
doTest2CandidatesWithPreselection();
|
||||
}
|
||||
|
||||
private void doTest2CandidatesWithPreselection() {
|
||||
myFixture.configureByFile(getTestName(false) + ".java");
|
||||
|
||||
MethodParameterInfoHandler handler = new MethodParameterInfoHandler();
|
||||
|
||||
Reference in New Issue
Block a user