enable static import quick fix on "method expected" error (IDEA-169966)

This commit is contained in:
Anna.Kozlova
2017-03-21 11:40:40 +01:00
parent cf10709f77
commit 278d43dc00
3 changed files with 20 additions and 0 deletions

View File

@@ -456,6 +456,7 @@ public class HighlightMethodUtil {
QuickFixAction.registerQuickFixAction(highlightInfo, range, QUICK_FIX_FACTORY.createCreateMethodFromUsageFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, range, QUICK_FIX_FACTORY.createCreateAbstractMethodFromUsageFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, range, QUICK_FIX_FACTORY.createCreatePropertyFromUsageFix(methodCall));
QuickFixAction.registerQuickFixAction(highlightInfo, range, QUICK_FIX_FACTORY.createStaticImportMethodFix(methodCall));
if (resolved instanceof PsiVariable && languageLevel.isAtLeast(LanguageLevel.JDK_1_8)) {
PsiMethod method = LambdaUtil.getFunctionalInterfaceMethod(((PsiVariable)resolved).getType());
if (method != null) {

View File

@@ -0,0 +1,11 @@
// "Import static method 'java.util.Collections.emptyList'" "true"
import java.util.List;
import static java.util.Collections.emptyList;
public class X {
String emptyList = "";
List<String> get() {
return emptyList();
}
}

View File

@@ -0,0 +1,8 @@
// "Import static method 'java.util.Collections.emptyList'" "true"
import java.util.List;
public class X {
String emptyList = "";
List<String> get() {
return <caret>emptyList();
}
}