Fix displaying shortcuts for intention actions

Was broken in c776e56470
This commit is contained in:
Konstantin Kolosovsky
2017-04-25 16:19:57 +03:00
parent 0de3d06cf4
commit da17449807
@@ -143,7 +143,7 @@ public class IntentionActionWithTextCaching implements Comparable<IntentionActio
}
// IntentionAction which wraps the original action and then marks it as executed to hide it from the popup to avoid invoking it twice accidentally
private class MyIntentionAction implements IntentionAction, IntentionActionDelegate, Comparable<MyIntentionAction> {
private class MyIntentionAction implements IntentionAction, IntentionActionDelegate, Comparable<MyIntentionAction>, ShortcutProvider {
private final IntentionAction myAction;
private final BiConsumer<IntentionActionWithTextCaching, IntentionAction> myMarkInvoked;
@@ -205,6 +205,12 @@ public class IntentionActionWithTextCaching implements Comparable<IntentionActio
return myAction.getElementToMakeWritable(currentFile);
}
@Nullable
@Override
public ShortcutSet getShortcut() {
return myAction instanceof ShortcutProvider ? ((ShortcutProvider)myAction).getShortcut() : null;
}
@Override
public int compareTo(@NotNull final MyIntentionAction other) {
if (myAction instanceof Comparable) {