From 7a88938774b0bf95b0b33f776a193fa073628bbe Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Mon, 25 Jun 2018 15:43:35 +0300 Subject: [PATCH] enable search by inspection short name (IDEA-194409) --- .../codeInspection/actions/GotoInspectionModel.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/actions/GotoInspectionModel.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/GotoInspectionModel.java index 9d2362e67eeb..fc5c83d40159 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/actions/GotoInspectionModel.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/GotoInspectionModel.java @@ -48,13 +48,16 @@ public class GotoInspectionModel extends SimpleChooseByNameModel { for (ScopeToolState state : rootProfile.getAllTools()) { InspectionToolWrapper tool = LocalInspectionToolWrapper.findTool2RunInBatch(project, null, rootProfile, state.getTool()); if (tool != null) { - String name = tool.getDisplayName() + " " + StringUtil.join(tool.getGroupPath(), " "); - myToolNames.put(name, tool); + myToolNames.put(getSearchString(tool), tool); } } myNames = ArrayUtil.toStringArray(myToolNames.keySet()); } + private static String getSearchString(InspectionToolWrapper tool) { + return tool.getDisplayName() + " " + StringUtil.join(tool.getGroupPath(), " ") + " " + tool.getShortName(); + } + @Override public ListCellRenderer getListCellRenderer() { return myListCellRenderer; @@ -77,8 +80,7 @@ public class GotoInspectionModel extends SimpleChooseByNameModel { @Override public String getElementName(final Object element) { if (element instanceof InspectionElement) { - InspectionToolWrapper entry = ((InspectionElement)element).getToolWrapper(); - return entry.getDisplayName() + " " + StringUtil.join(entry.getGroupPath(), " "); + return getSearchString(((InspectionElement)element).getToolWrapper()); } return null; }