tab completion shouldn't overwrite ) in groovy named arguments

This commit is contained in:
peter
2011-07-05 11:33:03 +02:00
parent 9ed6608005
commit 1d2c3f8a48
2 changed files with 14 additions and 1 deletions
@@ -134,7 +134,8 @@ public class GrArgumentLabelImpl extends GroovyPsiElementImpl implements GrArgum
}
public PsiReference getReference() {
return this;
final PsiElement name = getNameElement();
return name instanceof GrLiteral || name instanceof LeafPsiElement ? this : null;
}
@Nullable
@@ -516,6 +516,18 @@ in<caret>"""
myFixture.checkResult "def x = []; x.add(<caret>) this"
}
public void testEatingClosingParenthesis() {
checkCompletion """
def xxxx = []
def xxxy = []
foo((xx<caret>):2)
""", '\t', """
def xxxx = []
def xxxy = []
foo((xxxx<caret>):2)
"""
}
public void testDontAddStaticImportSecondTime() {
configure """import static java.lang.String.format
form<caret>"""