Custom Language - Find Usages: File structure not showing Follow
Hello,
I'm trying to develop a custom language plugin using the tutorial (https://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support/find_usages_provider.html). I extended this by typical INI/config file format blocks and property referencing, meaning the syntax enables something similar to this:
[block1]
abc = xyz
property = value
[block2]
whatever = 123
test = $abc # references the property abc
Everything works fine, the structure view shows the properties under the blocks, but when I move the cursor on the property abc and try to find usages the usages are not listed under each block like in the structure view, although the file structure grouper is enabled. Also the location string is not displayed as promised by the description of getLocation() in ItemRepresentation. How can I find out what I am doing wrong? Does someone have a hint where to look, what to debug etc.? I'm using a ReferenceContributor to gather the references correctly. Is this okay?
Kind regards
Please sign in to leave a comment.
Could you please share your sources?
Thank you for your answer.
I cannot share it right now and I would need some weeks to audit every single bit of it before uploading.
Is there no general hint on where to look or at least some kind of documentation on how everything is intertwined? No command reference documentation (javadoc/doxygen/...) or similar? Maybe something people usually do wrong with file structures or find usages? Or where I could put a breakpoint to debug it?
I'm still not quite sure I understand what the exact problem is, but here's a guess: did you implement
ElementDescriptionProvider
? see https://www.jetbrains.org/intellij/sdk/docs/reference_guide/custom_language_support/find_usages.html last paragraphNo, but I tried it now and it only changes several displayed texts, depending on the second argument passed to the ElementDescriptionProvider. It does not change the file's structure inside the find usages window.
Okay I found out that you need to implement the FileStructureGroupRuleProvider and register it inside the plugin.xml like this:
It is not enough to modify your StructureViewModelBase to return your own Grouper and it is not enough that IntelliJ basically knows the structure through the PsiElements and the StructureViewModel.