mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method ref: create method from usages accept method ref in argument
This commit is contained in:
+3
-1
@@ -254,7 +254,9 @@ public class CreateFromUsageUtils {
|
||||
names = new String[]{"p" + i};
|
||||
}
|
||||
|
||||
if (argType == null || PsiType.NULL.equals(argType) || argType instanceof PsiLambdaExpressionType) {
|
||||
if (argType == null || PsiType.NULL.equals(argType) ||
|
||||
argType instanceof PsiLambdaExpressionType ||
|
||||
argType instanceof PsiMethodReferenceType) {
|
||||
argType = PsiType.getJavaLangObject(psiManager, resolveScope);
|
||||
}
|
||||
PsiParameter parameter;
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Create Method 'f'" "true"
|
||||
class A {
|
||||
{
|
||||
f(A::foo);
|
||||
}
|
||||
|
||||
private void f(Object foo) {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.</selection>
|
||||
}
|
||||
|
||||
static int foo() {
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create Method 'f'" "true"
|
||||
class A {
|
||||
{
|
||||
f<caret>(A::foo);
|
||||
}
|
||||
static int foo() {
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user