How to insert action directly after generate menu item?
Answered
I'm trying to make an action show up directly below "==() and hashCode" in the generate menu. I used this:
<actions>
<action id="action.GenerateCopyWithMethodAction" class="action.GenerateCopyWithMethodAction" text="copyWith">
<add-to-group group-id="GenerateGroup" anchor="after" relative-to-action="GenerateEquals"/>
</action>
</actions>
But it shows it at the bottom of the generate menu (in the second section, after "Copyright"). I also tried using another relative actions, like GenerateConstructor, GenerateGetterAndSetter, both of which are definitely available in my menu, and it still appears at the bottom. Also, no changes replacing the anchor with "before". What am I doing wrong?
Please sign in to leave a comment.
You'll need to use group-id="JavaGenerateGroup1" instead of "GenerateGroup", see JavaActions.xml declaration in IJ Community.
@Yann Cebron Thanks! But now it appears fixed at the beginning of the second section (tried with GenerateSetter and GenerateEquals as relative item). Is it not possible to insert the item in the top section directly below the relative action? Or am I still doing something wrong? Here the current xml:
Maybe related - This is for Android Studio using the Dart language plugin (in Dart files obviously).
See Dart's plugin.xml. Your anchor is `Generate.EqualsAndHashcode.Dart`.
That works, thanks!
Last question: Is there a way to make the inspector recognize this anchor as valid? Other than suppressing it with
I guess you need to add Dart plugin jar to your IntelliJ Plugin SDK Classpath.
Noted. Thanks. For now I'll let it like this since it seems to work.