com.intellij.psi.xml.XmlComment

Am I missing something or is there no way to create an XmlComment using the OpenAPI? PsiElementFactory has a createCommentFromText method that returns a PsiComment but nothing to create an XmlComment and XmlComment isn't related to a PsiComment.

I've look at the 4.5 and Irida Javadocs.

Help.

Rick

2 comments

A nasty workaround that *might* work is to use something like that:

tag = factory.createTagFromText("]]>");
comment = PsiTreeUtil.getChildOfType(tag, XmlComment.class);

HTH,
Sascha

Rick Maddy wrote:

Am I missing something or is there no way to create an XmlComment using the OpenAPI? PsiElementFactory has a createCommentFromText method that returns a PsiComment but nothing to create an XmlComment and XmlComment isn't related to a PsiComment.

I've look at the 4.5 and Irida Javadocs.

Help.

Rick

0

That does work - thanks for the great idea.

Rick

0

Please sign in to leave a comment.