How to implement usages find for xml attribute?
Now If I press Alt+F7 in xml attribute, and IDEA give me "Cannot search for usages" error. I know Spring plugin has implemented this feature for bean usages find. How can I implement usages find for custom xml attribute? thanks.
请先登录再写评论。
Do you mean attribute value with name of something? Then you should
associate PsiMetaData (see MetaRegistry) with the tag corresponding to
this something, and put a reference to the tag in the attribute value.
All your other references should also resolve to this tag.
yes, Peter, where can I find an example for reference?
I have a xml code as following:
]]>
and Java code as follwing:
client.queryForObject("select.user");
I make "select.user" attribute value refer to "select" tag, and make "select.user" parameter to reference to "select" tag. I press alt+f7 in "select.user", and find usage dialog appears, but IDEA report no usages found. Am I wrong with something?
Message was edited by:
linux_china
Message was edited by:
linux_china
SpringApplicationComponent registers the MetaData. The self-reference is
registered by @Referencing annotation with SpringBeanIdConverter on
method DomSpringBean#getId()
Thanks, Peter, and I have implemented such feature. :)