use of org.ballerinalang.plugins.idea.psi.AnnotationAttributeValueNode in project ballerina by ballerina-lang.
the class BallerinaDocumentationProvider method getParamDescriptions.
/**
* Returns the parameters from the {@code Param} doc annotations.
*
* @param annotations list of all annotations
* @return list of parameter strings
*/
@NotNull
private static List<String> getParamDescriptions(List<PsiElement> annotations) {
List<String> params = new LinkedList<>();
for (PsiElement annotation : annotations) {
AnnotationAttributeValueNode valueNode = getAnnotationAttributeNode(annotation, DOC_PARAM);
if (valueNode == null) {
continue;
}
String text = valueNode.getText();
// We ignore the " in the beginning and end. We also replace the ":" with " -" to increase the
// readability of the docs.
params.add(text.substring(1, text.length() - 1).replaceFirst(DOC_SEPARATOR, " -"));
}
return params;
}
Aggregations