Load typeahead actions from the registry

This commit is contained in:
Denis Fokin
2018-02-19 17:49:56 +03:00
parent 5b8588a8d0
commit 35df44f4b0
2 changed files with 8 additions and 7 deletions
@@ -35,6 +35,7 @@ import com.intellij.openapi.keymap.impl.KeyState;
import com.intellij.openapi.ui.JBPopupMenu;
import com.intellij.openapi.util.*;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.IdeFrame;
import com.intellij.openapi.wm.WindowManager;
@@ -1308,18 +1309,14 @@ public class IdeEventQueue extends EventQueue {
private final Set<Shortcut> shortcutsShowingPopups = new HashSet<>();
private final Set<String> actionsShowingPopupsList = new HashSet<>();
private final List<String> actionsShowingPopupsList = new ArrayList<>();
private long lastTypeaheadTimestamp = -1;
private Set<Shortcut> getShortcutsShowingPopups () {
if (KeymapManager.getInstance().getActiveKeymap() != null) {
// move to a config
actionsShowingPopupsList.add("GotoClass");
actionsShowingPopupsList.add("GotoFile");
actionsShowingPopupsList.add("GotoSymbol");
actionsShowingPopupsList.add("FindInPath");
actionsShowingPopupsList.add("ReplaceInPath");
String actionsAwareTypeaheadActionsList = Registry.get("action.aware.typeahead.actions.list").asString();
actionsShowingPopupsList.addAll(StringUtil.split(actionsAwareTypeaheadActionsList, ","));
actionsShowingPopupsList.forEach(actionId -> {
List<Shortcut> shortcuts = Arrays.asList(KeymapManager.getInstance().getActiveKeymap().getShortcuts(actionId));
if (TYPEAHEAD_LOG.isDebugEnabled()) {
@@ -1483,7 +1483,11 @@ webstorm.vue.project.generator=false
webstorm.vue.project.generator.description=Vue project generator
action.aware.typeAhead=false
action.aware.typeAhead.description=Enables action aweare typeahead
action.aware.typeaheadTimout=10000
action.aware.typeaheadTimout.description=The action aware typeahead is canceled in this amount of time if the typeahead fails.
action.aware.typeahead.actions.list=GotoClass,GotoFile,GotoSymbol,FindInPath,ReplaceInPath,FileStructurePopup
action.aware.typeahead.actions.list.description=List of actions that may show popups.
show.new.plugin.page=false
show.new.plugin.page.description=Show new plugin page configurable