use of org.eclipse.xtend.ide.codebuilder.VariableNameAcceptor in project xtext-xtend by eclipse.
the class AbstractExecutableBuilder method appendParameters.
protected ISourceAppender appendParameters(final ISourceAppender appendable) {
ISourceAppender _xblockexpression = null;
{
appendable.append("(");
final HashSet<String> notAllowed = CollectionLiterals.<String>newHashSet();
boolean _isEmpty = this.parameterBuilders.isEmpty();
boolean _not = (!_isEmpty);
if (_not) {
AbstractParameterBuilder _last = IterableExtensions.<AbstractParameterBuilder>last(this.parameterBuilders);
_last.setVarArgsFlag(this.varArgsFlag);
}
int _size = this.parameterBuilders.size();
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _size, true);
for (final Integer i : _doubleDotLessThan) {
{
final AbstractParameterBuilder parameterBuilder = this.parameterBuilders.get((i).intValue());
final VariableNameAcceptor acceptor = new VariableNameAcceptor(notAllowed);
String _name = parameterBuilder.getName();
boolean _tripleEquals = (_name == null);
if (_tripleEquals) {
this._jdtVariableCompletions.getVariableProposals(parameterBuilder.getType().getIdentifier(), this.getContext(), JdtVariableCompletions.VariableType.PARAMETER, notAllowed, acceptor);
parameterBuilder.setName(acceptor.getVariableName());
}
parameterBuilder.build(appendable);
int _size_1 = this.parameterBuilders.size();
int _minus = (_size_1 - 1);
boolean _notEquals = ((i).intValue() != _minus);
if (_notEquals) {
appendable.append(", ");
}
}
}
_xblockexpression = appendable.append(")");
}
return _xblockexpression;
}
Aggregations