From 9546767d514bdf804c857f7f9275f181f182cb04 Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Sat, 20 Mar 2021 19:29:01 +0100 Subject: [PATCH] inspection documentation: exclude UI refs from documentation GitOrigin-RevId: 168128b60ca13768334220b4c88dc904827a2d12 --- .../InspectionDescriptionDocumentationProvider.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/actions/InspectionDescriptionDocumentationProvider.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/InspectionDescriptionDocumentationProvider.java index e98edab3545b..6fecf3e867b7 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/actions/InspectionDescriptionDocumentationProvider.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/InspectionDescriptionDocumentationProvider.java @@ -3,6 +3,7 @@ package com.intellij.codeInspection.actions; import com.intellij.codeInspection.ex.InspectionToolWrapper; +import com.intellij.codeInspection.ui.InspectionNodeInfo; import com.intellij.lang.documentation.AbstractDocumentationProvider; import com.intellij.lang.documentation.DocumentationMarkup; import com.intellij.openapi.util.text.StringUtil; @@ -17,8 +18,13 @@ public class InspectionDescriptionDocumentationProvider extends AbstractDocument } InspectionToolWrapper toolWrapper = ((InspectionElement)element).getToolWrapper(); + String description = toolWrapper.loadDescription(); + if (description == null) { + return null; + } return DocumentationMarkup.DEFINITION_START + StringUtil.escapeXmlEntities(toolWrapper.getDisplayName()) + DocumentationMarkup.DEFINITION_END + - DocumentationMarkup.CONTENT_START + toolWrapper.loadDescription() + + DocumentationMarkup.CONTENT_START + + InspectionNodeInfo.stripUIRefsFromInspectionDescription(description) + DocumentationMarkup.CONTENT_END; } }