Code completion: template item for function taking lambda with 2 or more parameters (KT-4855) + better handling of type instantiation in smart completion

This commit is contained in:
Valentin Kipyatkov
2014-04-22 22:10:42 +04:00
parent 0057843c08
commit e8805f69bf
33 changed files with 428 additions and 269 deletions
@@ -54,6 +54,11 @@ public class JetCallExpression extends JetReferenceExpression implements JetCall
return (JetTypeArgumentList) findChildByType(JetNodeTypes.TYPE_ARGUMENT_LIST);
}
/**
* Normally there should be only one (or zero) function literal arguments.
* The returned value is a list for better handling of commonly made mistake of a function taking a lambda and returning another function.
* Most of users can simply ignore lists of more than one element.
*/
@Override
@NotNull
public List<JetExpression> getFunctionLiteralArguments() {