@Override public JvmIdentifiableElement getFeature() { return description.getElementOrProxy(); }
@Override /* @Nullable */ public JvmIdentifiableElement getFeature() { return description.getElementOrProxy(); }
protected String getSignature(IIdentifiableElementDescription desc) { String descName = desc.getName().getFirstSegment(); StringBuilder builder = new StringBuilder(64).append(descName); JvmIdentifiableElement elementOrProxy = desc.getElementOrProxy(); if (elementOrProxy instanceof JvmExecutable) { JvmExecutable executable = (JvmExecutable) desc.getElementOrProxy(); String opName = executable.getSimpleName(); if (opName.length() - 3 == descName.length() && opName.startsWith("set")) { builder.append("="); } appendParameters(executable, builder, desc.isExtension()); } return builder.toString(); }
protected String getExtensionSignature(IIdentifiableElementDescription desc) { JvmOperation operation = (JvmOperation) desc.getElementOrProxy(); StringBuilder builder = new StringBuilder(64).append(desc.getName()); String opName = operation.getSimpleName(); if (opName.length() - 3 == desc.getName().getFirstSegment().length() && opName.startsWith("set")) { builder.append("="); } appendParameters(operation, builder, desc.isExtension()); return builder.toString(); }
protected LightweightTypeReference getFirstParameterType(IIdentifiableElementDescription candidate) { JvmOperation operation = (JvmOperation) candidate.getElementOrProxy(); if (operation.getParameters().isEmpty()) { return null; } return getParameterType(operation.getParameters().get(0)); }
protected boolean isValidAssignmentName(IIdentifiableElementDescription description) { JvmIdentifiableElement candidate = description.getElementOrProxy(); if (candidate.eClass() == TypesPackage.Literals.JVM_OPERATION) { if (candidate.getSimpleName().equals(description.getName().getFirstSegment())) { return false; } else if (!candidate.getSimpleName().startsWith("set")) { return false; } } return true; }
@Override public boolean validate(IAcceptor<? super AbstractDiagnostic> result) { JvmType type = (JvmType) description.getElementOrProxy(); String typeKind = ""; if (type instanceof JvmPrimitiveType || type instanceof JvmVoid) { typeKind = "primitive type"; } else if (type instanceof JvmAnnotationType) { typeKind = "annotation type"; } else if (type instanceof JvmEnumerationType) { typeKind = "enum type"; } else if (type instanceof JvmGenericType && ((JvmGenericType) type).isInterface()) { typeKind = "interface type"; } else if (type instanceof JvmTypeParameter) { typeKind = "type parameter"; } String message = String.format("Cannot instantiate the %s %s", typeKind, type.getSimpleName()); AbstractDiagnostic diagnostic = new EObjectDiagnosticImpl(Severity.ERROR, IssueCodes.ILLEGAL_CLASS_INSTANTIATION, message, getExpression(), XbasePackage.Literals.XCONSTRUCTOR_CALL__CONSTRUCTOR, -1, null); result.accept(diagnostic); return false; }
private boolean isThisOrSuper() { if ((THIS.equals(description.getName()) || SUPER.equals(description.getName())) && (description.getElementOrProxy() instanceof JvmType) && !isSyntacticReceiverPossibleArgument()) { return true; } return false; }
protected XbaseIdeCrossrefProposalProvider.ProposalBracketInfo getProposalBracketInfo(final IEObjectDescription proposedDescription, final ContentAssistContext contentAssistContext) { final XbaseIdeCrossrefProposalProvider.ProposalBracketInfo info = new XbaseIdeCrossrefProposalProvider.ProposalBracketInfo(); if ((proposedDescription instanceof IIdentifiableElementDescription)) { final JvmIdentifiableElement jvmFeature = ((IIdentifiableElementDescription)proposedDescription).getElementOrProxy(); if ((jvmFeature instanceof JvmExecutable)) { final EList<JvmFormalParameter> parameters = ((JvmExecutable)jvmFeature).getParameters();
protected IConstructorLinkingCandidate createCandidate(XConstructorCall constructorCall, IIdentifiableElementDescription description) { StackedResolvedTypes stackedResolvedTypes = resolvedTypes.pushTypes(constructorCall); ExpressionTypeComputationState state = createExpressionComputationState(constructorCall, stackedResolvedTypes); if (description instanceof ScopeProviderAccess.ErrorDescription) { return new UnresolvableConstructorCall(constructorCall, ((ScopeProviderAccess.ErrorDescription) description).getNode(), description.getName().toString(), state); } else if (description.getElementOrProxy() instanceof JvmType) { return new TypeInsteadOfConstructorLinkingCandidate(constructorCall, description, state); } else { return new ConstructorLinkingCandidate(constructorCall, description, getSingleExpectation(state), state); } }
if (objectDesc instanceof IIdentifiableElementDescription) { _matched=true; JvmIdentifiableElement _elementOrProxy = ((IIdentifiableElementDescription)objectDesc).getElementOrProxy(); boolean _matched_1 = false; if (_elementOrProxy instanceof JvmField) {
OperatorMapping operatorMapping = services.getOperatorMapping(); if (operatorMapping.getCompoundOperators().contains(description.getName())) { JvmIdentifiableElement feature = description.getElementOrProxy(); String methodName = feature.getSimpleName(); if (operatorMapping.isCompoundMethod(methodName)) {