mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-53066 java smart completion: autoinsert likely generic methods
GitOrigin-RevId: 6dcca0e0c39758de0a9c3bb77ded8b2c61ad4cf0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d58509eecb
commit
9007758412
@@ -501,7 +501,11 @@ public class JavaCompletionSorting {
|
||||
type = callItem.getSubstitutor().substitute(type);
|
||||
}
|
||||
|
||||
return type instanceof PsiClassType && ((PsiClassType)type).resolve() instanceof PsiTypeParameter;
|
||||
if (type instanceof PsiClassType) {
|
||||
PsiClass target = ((PsiClassType)type).resolve();
|
||||
return target instanceof PsiTypeParameter && ((PsiTypeParameter)target).getOwner() instanceof PsiMethod;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static class PreferSimple extends LookupElementWeigher {
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
abstract class K<T> {
|
||||
protected abstract T get();
|
||||
private void m() {
|
||||
T t = get();<caret>
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
abstract class K<T> {
|
||||
protected abstract T get();
|
||||
private void m() {
|
||||
T t = g<caret>
|
||||
}
|
||||
}
|
||||
+2
@@ -606,6 +606,8 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
myFixture.assertPreferredCompletionItems(0, "valueOf");
|
||||
}
|
||||
|
||||
public void testAutoInsertMethodReturningClassTypeParam() { doActionTest(); }
|
||||
|
||||
public void testIntPlusLongNotDouble() { doTest(); }
|
||||
|
||||
public void testNestedAssignments() { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user