Comment/uncomment part of XML programmatically

Hi,

Is there any way to comment / uncomment a piece of XML code programmatically?

I know that is function for java: 

JavaPsiFacade.getElementFactory(project).createCommentFromText

but this is for java and creates new comment from text. Maybe is simpler way to comment of piece of xml with IDEA stuff?

The second question: Is there any way to easily find an xml element using intellij tools? For now i use getText() method on PsiElement but I have the impression that I'm doing it contrary with good practise.

 

 

0

请先登录再写评论。