How to get list of XmlTag objects in selection?
I need to add a custom action to the XML editor, and I'm trying to figure out the best way to create a list of Xml tags in the selection. I was able to get start and end PsiElement, and I can probably figure out the XML tags that those PsiElements belong to or are the children of, but I still cannot figure out a way to get a list of all tags in the DOM tree between tag A and tag B.
Perhaps there's a better option?
Please sign in to leave a comment.
I would iterate through DOM elements and check if their offsets (text ranges) belong to the selection.