use of org.eclipse.n4js.jsdoc.dom.LineTag in project n4js by eclipse.
the class LineTagTest method testLineTagWithRegion.
@SuppressWarnings("javadoc")
@Test
public void testLineTagWithRegion() {
String in = "/** foo.\n * @stubLineTagTitle {@region value} \n */";
AbstractLineTagDefinition tag = new StubLineTagWithRegionDefinition("stubLineTagTitle");
DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tag)), new TagDictionary<AbstractInlineTagDefinition>());
Doclet doclet = docletParser.parse(in);
LineTag lineTag = doclet.getLineTags().get(0);
TagValue region = lineTag.getValueByKey(StubLineTagWithRegionDefinition.REGION);
Text strcturedText = (Text) region.getContents().get(0);
assertEquals("@region value", strcturedText.getText());
}
use of org.eclipse.n4js.jsdoc.dom.LineTag in project n4js by eclipse.
the class DocletParserTest method testJSDocParsingWithoutMainDescription.
@SuppressWarnings("javadoc")
@Test
public void testJSDocParsingWithoutMainDescription() {
String in = "/** \n * @stubLineTagTitle \n */";
AbstractLineTagDefinition tag = new StubLineTagDefinition("stubLineTagTitle");
DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tag)), new TagDictionary<AbstractInlineTagDefinition>());
Doclet doclet = docletParser.parse(in);
LineTag lineTag = doclet.getLineTags().get(0);
assertEquals("stubLineTagTitle", lineTag.getTitle().getTitle());
}
use of org.eclipse.n4js.jsdoc.dom.LineTag in project n4js by eclipse.
the class N4JSDReader method processClassifier.
private void processClassifier(Multimap<String, SpecInfo> specInfoByName, Type testType, TClassifier ctype) {
RepoRelativePath rrp = RepoRelativePath.compute(testType.eResource(), n4jsCore);
Doclet testTypeDoclet = n4jsDocHelper.getDoclet(ctype.getAstElement());
Collection<FullMemberReference> testeeRefsFromType = getFullMemberRefsFromType(testTypeDoclet);
Collection<FullMemberReference> testeeTypeRefsFromType = getFullTypeRefsFromType(testTypeDoclet);
MemberList<TMember> allMembers = containerTypesHelper.fromContext(testType).allMembers(ctype, false, false);
for (TMember testMember : allMembers) {
boolean isOwnedMember = testMember.getContainingType() == ctype;
if (testMember instanceof TMethod && AnnotationDefinition.TEST_METHOD.hasAnnotation(testMember)) {
EObject astElement = testMember.getAstElement();
if (!astElement.eIsProxy()) {
Doclet testMethodDoclet = n4jsDocHelper.getDoclet(astElement);
LineTag tag = findLinkToElementTag(testMethodDoclet, isOwnedMember);
if (tag != null) {
processTag(specInfoByName, rrp, testeeRefsFromType, testeeTypeRefsFromType, testMember, isOwnedMember, astElement, testMethodDoclet, tag);
}
} else {
System.err.println("cannot result AST when scanning for doclets: " + astElement);
}
}
}
}
use of org.eclipse.n4js.jsdoc.dom.LineTag in project n4js by eclipse.
the class AbstractLineTagDefinition method createLineTag.
/**
* Convenience method.
*/
protected LineTag createLineTag(TagTitle tagTitle) {
LineTag tag = DOM.createLineTag();
tag.setTagDefinition(this);
tag.setTitle(tagTitle);
return tag;
}
Aggregations