don't suggest return after dot

This commit is contained in:
peter
2012-02-15 16:37:48 +01:00
parent 6cda61d809
commit e15612982e
3 changed files with 13 additions and 1 deletions
@@ -637,7 +637,8 @@ public class JavaCompletionData extends JavaAwareCompletionData{
return true;
}
if (psiElement().withParents(PsiReferenceExpression.class, PsiExpressionStatement.class, PsiIfStatement.class).accepts(position)) {
if (psiElement().withParents(PsiReferenceExpression.class, PsiExpressionStatement.class, PsiIfStatement.class).andNot(
psiElement().afterLeaf(".")).accepts(position)) {
PsiElement stmt = position.getParent().getParent();
PsiIfStatement ifStatement = (PsiIfStatement)stmt.getParent();
if (ifStatement.getElseBranch() == stmt || ifStatement.getThenBranch() == stmt) {
@@ -0,0 +1,6 @@
public class Zoo {
{
if (true) toString().<caret>
}
}
@@ -1278,4 +1278,9 @@ public class ListUtils {
checkResult()
}
public void testNoReturnAfterDot() {
configure()
assert !('return' in myFixture.lookupElementStrings)
}
}