IDEA-96624 Groovy: don't complete primitive types with space in new-expression

This commit is contained in:
Max Medvedev
2012-12-05 13:35:27 +04:00
parent e57567c579
commit d76b142879
2 changed files with 9 additions and 1 deletions
@@ -135,7 +135,8 @@ public class GroovyCompletionData {
.afterLeaf(psiElement().withElementType(GroovyTokenTypes.kAS).withParent(GrSafeCastExpression.class))
.accepts(position);
addKeywords(result, !inCast, BUILT_IN_TYPES);
boolean inNew = psiElement().afterLeaf(psiElement(GroovyTokenTypes.kNEW)).accepts(position);
addKeywords(result, !inCast && !inNew, BUILT_IN_TYPES);
}
if (psiElement(GrReferenceExpression.class).inside(or(psiElement(GrWhileStatement.class), psiElement(GrForStatement.class))).accepts(parent)) {
@@ -1618,4 +1618,11 @@ new Foooo()<caret>
''')
}
void testBooleanInNewExpr() {
doBasicTest('''\
def b = new boolea<caret>
''', '''\
def b = new boolean<caret>
''')
}
}