void (@Nullable Project myProject, @NotNull GotoActionModel.MatchedValue value) { AnAction action = getAction(value); if (action == null) return; String id = ActionManager.getInstance().getId(action); Keymap activeKeymap = Optional.ofNullable(KeymapManager.getInstance()) .map(KeymapManager::getActiveKeymap) .orElse(null); if (activeKeymap == null) return; ApplicationManager.getApplication().invokeLater(() -> { Window window = myProject != null ? WindowManager.getInstance().suggestParentWindow(myProject) : KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow(); if (window == null) return; KeymapPanel.addKeyboardShortcut(id, ActionShortcutRestrictions.getInstance().getForActionId(id), activeKeymap, window); }); }