use of org.eclipse.xtext.parsetree.reconstr.ICommentAssociater in project xtext-core by eclipse.
the class CommentAssociationTest method createModel2CommentMap.
protected Multimap<EObject, String> createModel2CommentMap(Model model) {
ICompositeNode rootNode = NodeModelUtils.getNode(model).getRootNode();
ICommentAssociater commentAssociater = getInjector().getInstance(ICommentAssociater.class);
Map<ILeafNode, EObject> map = commentAssociater.associateCommentsWithSemanticEObjects(model, Collections.singleton(rootNode));
Multimap<EObject, String> multimap = ArrayListMultimap.create();
for (Map.Entry<ILeafNode, EObject> entry : map.entrySet()) {
multimap.put(entry.getValue(), entry.getKey().getText());
}
return multimap;
}
Aggregations