IDEA-CR-33342 trigger feature used on escape/execute command

This commit is contained in:
Dmitry.Krasilschikov
2018-06-08 14:19:12 +03:00
parent 63ecf61cd0
commit 59cdfcbc58
@@ -429,6 +429,8 @@ public class RunAnythingAction extends AnAction implements CustomComponentAction
onDone = () -> RunAnythingUtil.executeMatched(dataContext, pattern);
}
finally {
triggerUsed();
final ActionCallback callback = onPopupFocusLost();
if (onDone != null) {
callback.doWhenDone(onDone);
@@ -859,9 +861,7 @@ public class RunAnythingAction extends AnAction implements CustomComponentAction
.registerCustomShortcutSet(CustomShortcutSet.fromString("shift TAB"), editor, balloon);
AnAction escape = ActionManager.getInstance().getAction("EditorEscape");
DumbAwareAction.create(e -> {
if (myIsUsedTrigger) {
FeatureUsageTracker.getInstance().triggerFeatureUsed(RUN_ANYTHING);
}
triggerUsed();
if (myBalloon != null && myBalloon.isVisible()) {
myBalloon.cancel();
@@ -921,6 +921,13 @@ public class RunAnythingAction extends AnAction implements CustomComponentAction
}.registerCustomShortcutSet(CustomShortcutSet.fromString("LEFT"), editor, balloon);
}
private void triggerUsed() {
if (myIsUsedTrigger) {
FeatureUsageTracker.getInstance().triggerFeatureUsed(RUN_ANYTHING);
}
myIsUsedTrigger = false;
}
public void setAdText(@NotNull final String s) {
myPopup.setAdText(s, SwingConstants.LEFT);
@@ -1247,7 +1254,6 @@ public class RunAnythingAction extends AnAction implements CustomComponentAction
}
}
myActionEvent = null;
myIsUsedTrigger = false;
myLastInputText = null;
});
}