I am working on a plugin that should provide navigation between different XML files and between XML and Java sources. It's a bit similar to the Spring support.
The XML files have a <name> child (in contrast to the id attribute in Spring) and references are just like spring: ref="..." Navigation to Java sources will be a later step. There is also a naming convention for the xml files to support for the new plugin: *-definitions.xml
At the moment, I am stuck at one of the first steps: LineMarkerProvider and ReferenceContributor.
I used the "Custom Language Support" example as starting point. Because I do not have a custom language but want to extend xml functionality instead, I omitted the lexer, parser, file factory etc ... and went directly to LineMarkerProvider and ReferenceContributor.
What I have up to now is:
- class DefinitionsReference extends PsiReferenceBase<PsiElement>
- class DefinitionsUtil (similar to SimplePsiImplUtil)
- class DefinitionsLineMarkerProvider extends RelatedItemLineMarkerProvider
- class DefinitionsReferenceContributor extends PsiReferenceContributor
I registered the LineMarkerProvider (language=XML) and ReferenceContributor in plugin.xml and I added some logging output to verify if they are called and if the results are empty or not.
Although ReferenceContributor.PsiReferenceProvider.getReferencesByElement() as well as DefinitionsReference.multiResolve() and reslove() indeed return some non-emptyresults and LineMarkerProvider.collectNavigationMarkers() does find some plces to mark, I do neither get navigation gutter icons nor can I navigate from a ref= to the corresponding <name> tag. It says "cannot find declaration to go to".
Seems I missed some important detail.
What should I look for first ?
Thanks and Regards,