From 977a3b24e7bcd6750d3a3da0b1d2de3c871fbfda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Thu, 21 Jun 2012 10:59:06 +0200 Subject: [PATCH] DevKit: "register inspection" fix - show name of containing module for plugin.xml in selection popup --- .../src/inspections/quickfix/RegisterInspectionFix.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/devkit/src/inspections/quickfix/RegisterInspectionFix.java b/plugins/devkit/src/inspections/quickfix/RegisterInspectionFix.java index 15e3e9a891fe..b709bf83719d 100644 --- a/plugins/devkit/src/inspections/quickfix/RegisterInspectionFix.java +++ b/plugins/devkit/src/inspections/quickfix/RegisterInspectionFix.java @@ -19,6 +19,7 @@ import com.intellij.codeInsight.hint.HintManager; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.codeInspection.InspectionEP; import com.intellij.ide.TypePresentationService; +import com.intellij.ide.plugins.PluginManager; import com.intellij.openapi.application.Result; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.editor.Editor; @@ -30,6 +31,7 @@ import com.intellij.openapi.roots.ProjectRootManager; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.ui.popup.PopupStep; import com.intellij.openapi.ui.popup.util.BaseListPopupStep; +import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.Condition; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiClass; @@ -115,7 +117,12 @@ class RegisterInspectionFix implements IntentionAction { @NotNull @Override public String getTextFor(DomFileElement value) { - return value.getFile().getName(); + final String name = value.getFile().getName(); + if (!Comparing.equal(PluginManager.PLUGIN_XML, name)) { + return name; + } + final Module module = value.getModule(); + return module != null ? name + " (" + module.getName() + ")" : name; } @Override