Rename/find usages not working with reference to XML tag
已回答
Hey,
I have a custom reference pointing to an XmlTag
inside of a XML file, for example content.xml
. When I try a rename or find usages on the referenced XmlTag
it’s not working. When I debug, the reference's isReferenceTo()
method is called with a XmlElementDecl
instead of the expected XmlTag
. The XmlElementDecl
has the same name as the XML tag and is in a content.xml.dtd
file, which only exists in memory (it’s not created by me and the XML file has no DTD).
How can I achieve that the rename and find usages is attempted on the actual XmlTag
instead of on a pseudo DTD element?
请先登录再写评论。
Does said file have an actual DTD reference in its header?
No, it does not have a DTD referenced in the header. The files usually look like this:
Hello Victor, then you invoke find usages/rename on a tag name, it searches not for exact tag but for its declaration. To change this, you can add a reference from tag name to the tag itself.
Dmitry Avdeev, I finally found time to try this, but it's not yet working for me. I added a reference provider that adds references from the start and end tag name to the XML tag itself:
My custom
XmlTagNameReference
resolves to the XML tag, but I still get theXmlElementDecl
. Am I missing something?