use of org.eclipse.xtext.common.types.JvmAnyTypeReference in project xtext-xtend by eclipse.
the class XtendHoverSignatureProvider method _signature.
protected String _signature(XtendFunction function, boolean typeAtEnd) {
JvmOperation inferredOperation = associations.getDirectlyInferredOperation(function);
if (inferredOperation != null) {
String returnTypeString = "void";
JvmTypeReference returnType = inferredOperation.getReturnType();
if (returnType != null) {
if (returnType instanceof JvmAnyTypeReference) {
throw new IllegalStateException();
} else {
returnTypeString = getTypeName(returnType);
}
}
StringBuilder signature = new StringBuilder();
String typeParameter = uiStrings.typeParameters(function.getTypeParameters());
if (typeParameter != null && typeParameter.length() > 0) {
signature.append(typeParameter).append(" ");
}
signature.append(returnTypeString).append(" ");
signature.append(function.getName()).append(hoverUiStrings.parameters(inferredOperation));
signature.append(getThrowsDeclaration(inferredOperation));
return signature.toString();
}
return function.getName() + "()";
}
Aggregations