public List<XExpression> getSyntacticArguments(XAbstractFeatureCall expression) { if (expression instanceof XFeatureCall) { return ((XFeatureCall) expression).getFeatureCallArguments(); } if (expression instanceof XMemberFeatureCall) { return ((XMemberFeatureCall) expression).getMemberCallArguments(); } if (expression instanceof XAssignment) { return Collections.singletonList(((XAssignment) expression).getValue()); } if (expression instanceof XBinaryOperation) { return Collections.singletonList(((XBinaryOperation) expression).getRightOperand()); } // explicit condition to make sure we thought about it if (expression instanceof XUnaryOperation) { return Collections.emptyList(); } if (expression instanceof XPostfixOperation) { return Collections.emptyList(); } return Collections.emptyList(); }
protected boolean prependNewLineIfMultiline(final EObject obj) { boolean _switchResult = false; boolean _matched = false; if (obj instanceof XMemberFeatureCall) { _matched=true; _switchResult = this.prependNewLineIfMultiline(this.builder(((XMemberFeatureCall)obj).getMemberCallArguments())); } if (!_matched) { if (obj instanceof XClosure) { _matched=true; _switchResult = false; } } if (!_matched) { if (obj instanceof XBlockExpression) { _matched=true; _switchResult = false; } } if (!_matched) { _switchResult = true; } return _switchResult; }
protected boolean _isMultiParamInOwnLine(final XMemberFeatureCall fc, final FormattableDocument doc) { final ILeafNode closingBracket = this._nodeModelAccess.nodeForKeyword(fc, ")"); HiddenLeafs _hiddenLeafsBefore = null; if (closingBracket!=null) { _hiddenLeafsBefore=this._hiddenLeafAccess.getHiddenLeafsBefore(closingBracket); } boolean _tripleNotEquals = (_hiddenLeafsBefore != null); if (_tripleNotEquals) { int _newLines = this._hiddenLeafAccess.getHiddenLeafsBefore(closingBracket).getNewLines(); return (_newLines > 0); } final Iterable<XExpression> params = this.explicitParams(fc.getMemberCallArguments()); return ((IterableExtensions.size(params) > 1) && this.isEachExpressionInOwnLine(params)); }
if (featureCall.isExplicitOperationCall()) acceptor.accept(memberFeatureCallElements.getExplicitOperationCallLeftParenthesisKeyword_1_1_3_0_0()); List<XExpression> arguments = featureCall.getMemberCallArguments(); if (!arguments.isEmpty()) { if (featureCall.isExplicitOperationCall() && isXShortClosureAndBuilderSyntax(arguments, XbasePackage.Literals.XFEATURE_CALL__FEATURE_CALL_ARGUMENTS, nodes)) {
final ISemanticRegion open = format.prepend(this.textRegionExtensions.regionFor(call).keyword(this.grammar.getXMemberFeatureCallAccess().getExplicitOperationCallLeftParenthesisKeyword_1_1_3_0_0()), _function_2); final ISemanticRegion close = this.textRegionExtensions.regionFor(call).keyword(this.grammar.getXMemberFeatureCallAccess().getRightParenthesisKeyword_1_1_3_2()); this.formatFeatureCallParams(call.getMemberCallArguments(), open, close, format); } else { boolean _isEmpty = call.getMemberCallArguments().isEmpty(); boolean _not = (!_isEmpty); if (_not) { this.formatBuilderWithLeadingGap(this.builder(call.getMemberCallArguments()), format);
format.operator_add(_append_2); this.formatFeatureCallParamsMultiline(open, call.getMemberCallArguments(), format); } else { if ((((lineLength + (featureNode.getLength() * 2)) < format.getCfg().get(BasicFormatterPreferenceKeys.maxLineWidth)) || format.fitsIntoLine(callOffset, callLength, Function1<? super FormattableDocument, ? extends Iterable<FormattingData>> _append_3 = this._formattingDataFactory.append(op, _function_4); f.operator_add(_append_3); this.formatFeatureCallParamsWrapIfNeeded(open, call.getMemberCallArguments(), f); })))) { final Procedure1<FormattingDataInit> _function_4 = (FormattingDataInit it_1) -> { this.formatFeatureCallParamsWrapIfNeeded(open, call.getMemberCallArguments(), format); boolean _isEmpty = call.getMemberCallArguments().isEmpty(); boolean _not = (!_isEmpty); if (_not) { final XClosure builder = this.builder(call.getMemberCallArguments()); final Procedure1<FormattingDataInit> _function_10 = (FormattingDataInit it_1) -> { boolean _isMultilineLambda = this.isMultilineLambda(builder);
call.setFeature(superOperation); call.setMemberCallTarget(superCall.createReferenceToSuper()); final List<XExpression> arguments = call.getMemberCallArguments(); for (final IFormalParameterBuilder currentParam : sarlParams) { final XFeatureCall argumentSource = XbaseFactory.eINSTANCE.createXFeatureCall();