IDEA-54220 Code Completion for value() method in @interfaces could be added

This commit is contained in:
peter
2012-03-07 20:24:50 +04:00
parent 91fb524a30
commit f3b09cee3a
7 changed files with 38 additions and 5 deletions
@@ -0,0 +1,3 @@
@interface Some {
String v<caret>
}
@@ -0,0 +1,3 @@
@interface Some {
String value()<caret>
}
@@ -0,0 +1,7 @@
public class Foo {
public void a() {
int i = createStylesheetCombobox();
}
private int createStylesheetCombobox<caret>
}
@@ -94,7 +94,7 @@ public class HeavyNormalCompletionTest extends JavaCodeInsightFixtureTestCase {
myFixture.configureByFile("/codeInsight/completion/normal/" + getTestName(false) + ".java");
assertInstanceOf(myFixture.getFile().getVirtualFile().getFileSystem(), LocalFileSystem.class); // otherwise the completion copy won't be preserved which is critical here
myFixture.completeBasic();
assertOrderedEquals(myFixture.getLookupElementStrings(), "gAnInt", "getAaa", "getBbb");
assertOrderedEquals(myFixture.getLookupElementStrings(), "getAaa", "getBbb");
myFixture.getEditor().getCaretModel().moveToOffset(myFixture.getEditor().getCaretModel().getOffset() + 2);
assertNull(myFixture.completeBasic());
}
@@ -138,8 +138,7 @@ public class VariablesCompletionTest extends LightFixtureCompletionTestCase {
public void testUnresolvedMethodName() throws Exception {
configureByFile(FILE_PREFIX + "locals/" + "UnresolvedMethodName.java");
complete();
checkResultByFile(FILE_PREFIX + "locals/" + "UnresolvedMethodName.java");
assert myFixture.lookupElementStrings.containsAll(["creAnInt", "createStylesheetCombobox"])
checkResultByFile(FILE_PREFIX + "locals/" + "UnresolvedMethodName_after.java");
}
public void testArrayMethodName() throws Throwable {
@@ -172,6 +171,11 @@ public class VariablesCompletionTest extends LightFixtureCompletionTestCase {
configureByFile(FILE_PREFIX + getTestName(false) + ".java")
}
public void testAnnotationValue() {
configure()
checkResultByFile(FILE_PREFIX + getTestName(false) + "_after.java")
}
public void testConstructorParameterName() {
configure()
assertStringItems("color");