Highlight origin of reference on click Follow
I would like to highlight the referred node automatically when I select the reference. So something similar to pressing Cntr+Shift+F7 (Highlight Usages).
I see that there is an action called CLICK but not RELEASE. Or just a FOCUS action would be nice.
Is there something like that so that the user of the language does not need to press the shortcut?
Please sign in to leave a comment.
Unfortunately, there is no such action in the action map declaration.
However, you could implement it via API.
Here are the steps to do it:
1) Create the plugin solution and the project plugin there (https://confluence.jetbrains.com/display/MPSD20181/Plugin)
2) Subscribe to the editor component creation in the init block of the project plugin:
3) Define the
When the editor component is created, add the selection listener to its selection manager;
In the selection listener, you can find all the references of the selected node and highlight them:
In order to remove the messages, use
It's worth mentioning it is quite complicated task and we have this feature in our plan
thanks for your reply. Yes, looks costly. I think I will wait for an official implementation since it is not an important feature.
we have another use case for this RELEASE (or similar) action, so this feature would indeed be very useful!
Kind regards, Andreas