inspection view: remove tags in descriptor text

This commit is contained in:
Dmitry Batkovich
2018-11-23 12:51:15 +03:00
parent d988932296
commit 7ca8933f80
2 changed files with 5 additions and 8 deletions
@@ -29,7 +29,6 @@ import javax.swing.*;
* @author Dmitry Batkovich
*/
class InspectionTreeCellRenderer extends ColoredTreeCellRenderer {
private final InspectionResultsView myView;
private final InspectionTreeTailRenderer myTailRenderer;
InspectionTreeCellRenderer(InspectionResultsView view) {
@@ -44,7 +43,6 @@ class InspectionTreeCellRenderer extends ColoredTreeCellRenderer {
append(text);
}
};
myView = view;
}
@Override
@@ -65,7 +63,7 @@ class InspectionTreeCellRenderer extends ColoredTreeCellRenderer {
setIcon(node.getIcon(expanded));
}
private SimpleTextAttributes patchMainTextAttrs(InspectionTreeNode node, SimpleTextAttributes attributes) {
private static SimpleTextAttributes patchMainTextAttrs(InspectionTreeNode node, SimpleTextAttributes attributes) {
if (node.isExcluded()) {
return attributes.derive(attributes.getStyle() | SimpleTextAttributes.STYLE_STRIKEOUT, null, null, null);
}
@@ -13,11 +13,11 @@ import com.intellij.codeInspection.ex.InspectionToolWrapper;
import com.intellij.codeInspection.reference.RefElement;
import com.intellij.codeInspection.reference.RefEntity;
import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.profile.codeInspection.InspectionProfileManager;
import com.intellij.psi.PsiElement;
import com.intellij.util.ObjectUtils;
import com.intellij.util.containers.WeakStringInterner;
import com.intellij.xml.util.XmlStringUtil;
import gnu.trove.TObjectIntHashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -153,7 +153,8 @@ public class ProblemDescriptionNode extends SuppressableInspectionTreeNode {
@Override
public boolean isExcluded() {
return getPresentation().isExcluded(getDescriptor());
CommonProblemDescriptor descriptor = getDescriptor();
return descriptor != null && getPresentation().isExcluded(descriptor);
}
private static final WeakStringInterner NAME_INTERNER = new WeakStringInterner();
@@ -164,9 +165,7 @@ public class ProblemDescriptionNode extends SuppressableInspectionTreeNode {
CommonProblemDescriptor descriptor = getDescriptor();
if (descriptor == null) return "";
PsiElement element = descriptor instanceof ProblemDescriptor ? ((ProblemDescriptor)descriptor).getPsiElement() : null;
String name = XmlStringUtil.stripHtml(ProblemDescriptorUtil.renderDescriptionMessage(descriptor, element,
ProblemDescriptorUtil.TRIM_AT_TREE_END));
String name = StringUtil.removeHtmlTags(ProblemDescriptorUtil.renderDescriptionMessage(descriptor, element, ProblemDescriptorUtil.TRIM_AT_TREE_END), true);
return NAME_INTERNER.intern(name);
}