UsageProvider in a large framework for different filetypes
Hi guys. Again, i'm working on a plugin for APACHE ERP OFBiz.
I've worked out some references, and now i'd like to use the FindUsagesProvider.
Here is my problem : as far as i understand the documentation, the usages provider uses the caches that's built when importing project, wich is made according to filetype.
But the usages i'm trying to get can occur in multiple fileTypes for a single element.
Here is an example :
This would be a service definition in an XML file :
<service name="createMarketingCampaign" default-entity-name="MarketingCampaign" engine="entity-auto" invoke="create" auth="true">
<description>Create a MarketingCampaign record</description>
<permission-service service-name="marketingPermissionService" main-action="CREATE"/>
<auto-attributes include="pk" mode="OUT" optional="false"/>
<auto-attributes include="nonpk" mode="IN" optional="true"/>
</service>
And the name of this service could be called in an other xml file, but also in a java or groovy file :
<event type="service" path="" invoke="createMarketingCampaign"/>
or
Map<String, Object> serviceResult = dispatcher.runSync("createMarketingCampaign", context);
We also implemented in the plugin some of the dom description.
What would be the best way to achieve the usages search for this example ? given that references towards the definition are functional.
Please sign in to leave a comment.
If your custom PsiReference from code place(s) -> XML declaration (e.g., "name" attribute) are working fully and the names in code vs XML do not differ, you won't need to implement anything special AFAIU.
This would have been my thought, but it doesn't work :
References towards définition works, but not the find usages :
Here is the code i tried :
The attribute defining the ID in the XML must be annotated with com.intellij.util.xml.NameValue
It is :
Please disable your custom
lang.findUsagesProvider