suggest class names in foreach with missing type (IDEA-74350)

This commit is contained in:
peter
2011-09-15 19:33:26 +02:00
parent a9458eabd6
commit 330016badf
6 changed files with 31 additions and 1 deletions

View File

@@ -625,7 +625,11 @@ public class JavaCompletionContributor extends CompletionContributor {
iterator.advance();
}
if (!iterator.atEnd() && iterator.getTokenType() == JavaTokenType.LPARENTH) {
while (!iterator.atEnd() && ElementType.JAVA_COMMENT_OR_WHITESPACE_BIT_SET.contains(iterator.getTokenType())) {
iterator.advance();
}
if (!iterator.atEnd() && (iterator.getTokenType() == JavaTokenType.LPARENTH || iterator.getTokenType() == JavaTokenType.COLON)) {
return true;
}

View File

@@ -0,0 +1,6 @@
public class Zoo2 {
{
for (Stri<caret>child : dir.getChildren())
}
}

View File

@@ -0,0 +1,6 @@
public class Zoo2 {
{
for (Stri<caret> : dir.getChildren())
}
}

View File

@@ -0,0 +1,6 @@
public class Zoo2 {
{
for (String <caret> : dir.getChildren())
}
}

View File

@@ -0,0 +1,6 @@
public class Zoo2 {
{
for (String <caret>child : dir.getChildren())
}
}

View File

@@ -854,6 +854,8 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
public void testMethodParameterAnnotationClass() throws Throwable { doTest(); }
public void testPrimitiveCastOverwrite() throws Throwable { doTest '\t' }
public void testClassReferenceInFor() throws Throwable { doTest ' ' }
public void testClassReferenceInFor2() throws Throwable { doTest ' ' }
public void testVoidMethodsInNonVoidContext() throws Throwable {
configure()