annotation right click add a menu entry and get the author string
Answered
Hi all,
I wrote a plugin that allow me to get some specific information about some user.
I'm looking for a way to make it even better for users
Therefore I need to add a context menu to the annotate menu, ideally bellow the "show diff".
Unfortunately, I didn't find any information about how to proceed.
Can someone help me ?
How can I also get the subversion author (for ex xesi)
Thanks in advance for your help.

Please sign in to leave a comment.
of course i found that the corresponding source code is located within the AnnotateToggleAction
and I also know that actions are normally registered that way
You can take a look at https://github.com/JetBrains/intellij-community/blob/master/plugins/git4idea/src/git4idea/actions/GitShowCommitInLogAnnotationGutterActionProvider.java or https://github.com/iasemenov/git-extensions plugin.
Unlike other places, this menu uses an extension point for custom actions (AnnotationGutterActionProvider).
You can get author name from passed FileAnnotation via 'getAuthorsMappingProvider' and 'getLineRevisionNumber'.
See also 'UpToDateLineNumberListener' interface, that is used to pass annotated line, that was clicked on, to the AnAction.
Thanks Aleksey i'll check this right after work :)
The given source code are clear, I guess it will not be a big issue for me to use that :)
But I didn't saw any positioning, I guess that the newly added action is always at the bottom of the menu.
Is it possible to anchor it between two existing menu entries ?
I don't think it is possible.
thanks Aleksey, even if the position is not exactly what I wanted it is working like I wished ;)
subject can be marked as answered ;)