From 35df44f4b077b5342cbc1fad92a830fdd054c6cf Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Mon, 19 Feb 2018 17:47:13 +0300 Subject: [PATCH] Load typeahead actions from the registry --- .../src/com/intellij/ide/IdeEventQueue.java | 11 ++++------- platform/util/resources/misc/registry.properties | 4 ++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java index 3a6c2a6c0c06..5868e6d5155a 100644 --- a/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java +++ b/platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java @@ -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 shortcutsShowingPopups = new HashSet<>(); - private final Set actionsShowingPopupsList = new HashSet<>(); + private final List actionsShowingPopupsList = new ArrayList<>(); private long lastTypeaheadTimestamp = -1; private Set 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 shortcuts = Arrays.asList(KeymapManager.getInstance().getActiveKeymap().getShortcuts(actionId)); if (TYPEAHEAD_LOG.isDebugEnabled()) { diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 5ff739b8c18c..d1672b0b971e 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -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 \ No newline at end of file