use of org.eclipse.n4js.jsdoc.dom.Doclet in project n4js by eclipse.
the class DocletParser method parseMainDescription.
private Doclet parseMainDescription(JSDocCharScanner scanner) {
Doclet doclet = DomFactory.eINSTANCE.createDoclet();
doclet.setBegin(scanner.offset());
ContentNode description = descriptionParser.parse(scanner, inlineTagDictionary);
if (description != null) {
doclet.getContents().add(description);
}
return doclet;
}
use of org.eclipse.n4js.jsdoc.dom.Doclet in project n4js by eclipse.
the class LineTagWithFullMemberReferenceTest method test_fullRef_symbolName.
@SuppressWarnings("javadoc")
@Test
public void test_fullRef_symbolName() {
String in = "/** foo." + "\n * @testee n4/model/collections/DataSet.DataSet.#iterator" + "\n */";
AbstractLineTagDefinition tagDef = new LineTagWithFullMemberReference("testee");
DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tagDef)), new TagDictionary<AbstractInlineTagDefinition>());
Doclet doclet = docletParser.parse(in);
LineTag lineTag = doclet.getLineTags().get(0);
EList<ContentNode> contents = lineTag.getValueByKey(LineTagWithFullElementReference.REF).getContents();
FullMemberReference ref = (FullMemberReference) contents.get(0);
assertEquals("n4/model/collections/DataSet", ref.getModuleName());
assertEquals("DataSet", ref.getTypeName());
assertEquals("#iterator", ref.getMemberName());
}
use of org.eclipse.n4js.jsdoc.dom.Doclet in project n4js by eclipse.
the class SimpleN4JSDocTest method assertSameNumberOfLineTags.
private void assertSameNumberOfLineTags(int expectedNumberOfTags, String jsdocString) {
DocletParser docletParser = new N4JSDocletParser();
Doclet doclet = docletParser.parse(jsdocString);
assertEquals("Line tag number differs", expectedNumberOfTags, doclet.getLineTags().size());
}
use of org.eclipse.n4js.jsdoc.dom.Doclet in project n4js by eclipse.
the class DocletDescriptionParserTest method testDescriptionWithUnknownInlineTag.
@SuppressWarnings("javadoc")
@Test
public void testDescriptionWithUnknownInlineTag() {
String in = "/** This is the description with {@unkonwnInlineTag parsed as text} ..and finish description. \n */";
AbstractInlineTagDefinition inlineTag = new StubInlineTagDefinition("inline");
DocletParser docletParser = new DocletParser(null, new TagDictionary<>(Arrays.asList(inlineTag)));
Doclet doclet = docletParser.parse(in);
EList<ContentNode> contents = doclet.getContents();
Text descr = (Text) contents.get(0);
assertEquals("This is the description with {@unkonwnInlineTag parsed as text} ..and finish description.", descr.getText());
}
use of org.eclipse.n4js.jsdoc.dom.Doclet 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());
}
Aggregations