@Check public void checkExplicitOperationCall(XFeatureCall featureCall) { if (featureCall.getFeature() instanceof JvmOperation && !featureCall.isExplicitOperationCallOrBuilderSyntax() && featureCall.getFeature().getSimpleName().equals(featureCall.getConcreteSyntaxFeatureName())) { addIssue("Method call without parentheses", featureCall, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE, OPERATION_WITHOUT_PARENTHESES); } }
protected boolean isPotentialTypeLiteralImpl(XExpression featureCall, /* @Nullable */ IResolvedTypes resolvedTypes, boolean staticNotation) { if (featureCall instanceof XMemberFeatureCall) { XMemberFeatureCall casted = (XMemberFeatureCall) featureCall; if (casted.isExplicitOperationCallOrBuilderSyntax() || casted.isNullSafe()) { return false; } XExpression target = casted.getMemberCallTarget(); if (casted.isExplicitStatic() != staticNotation) { return false; } return isPotentialTypeLiteralImpl(target, resolvedTypes, staticNotation); } if (featureCall instanceof XFeatureCall) { XFeatureCall casted = (XFeatureCall) featureCall; if (casted.isExplicitOperationCallOrBuilderSyntax()) { return false; } if (resolvedTypes == null) return true; LightweightTypeReference knownType = resolvedTypes.getActualType(casted); if (knownType == null || knownType.isUnknown()) { return true; } } return false; }
if (featureCall.isExplicitOperationCallOrBuilderSyntax()) { if (featureCall.isExplicitOperationCall()) acceptor.accept(featureCallElements.getExplicitOperationCallLeftParenthesisKeyword_3_0_0());
/** * This method serves as an entry point for the content assist scoping for simple feature calls. * @param context the context e.g. a for loop expression, a block or a catch clause */ public IScope createSimpleFeatureCallScope(EObject context, IFeatureScopeSession session, IResolvedTypes resolvedTypes) { IScope root = IScope.NULLSCOPE; if (context instanceof XFeatureCall) { XFeatureCall featureCall = (XFeatureCall) context; if (!featureCall.isExplicitOperationCallOrBuilderSyntax()) { root = createTypeLiteralScope(context, QualifiedName.EMPTY, root, session, resolvedTypes); if (isDefiniteTypeLiteral(featureCall)) { return root; } } } IScope staticImports = createStaticFeaturesScope(context, root, session); IScope staticMembers = createStaticScope(asAbstractFeatureCall(context), null, null, staticImports, session, resolvedTypes); IScope staticExtensions = createStaticExtensionsScope(null, null, context, staticMembers, session, resolvedTypes); // we don't want to use captured instances of 'IT' as dynamic extension implicit argument // thus the dynamic extension scope only works for the *real* local variables IScope dynamicExtensions = createDynamicExtensionsScope(null, null, context, staticExtensions, session, resolvedTypes); IScope localVariables = createImplicitFeatureCallAndLocalVariableScope(context, dynamicExtensions, session, resolvedTypes); return localVariables; }