From a2d9e4fe3353289d00b226ce689c715c5ab95f7a Mon Sep 17 00:00:00 2001 From: Dmitry Avdeev Date: Wed, 29 Oct 2014 16:45:39 +0300 Subject: [PATCH] IDEA-37004 TLD: tag/body-content value could be supported --- .../jsp/impl/JspElementDescriptor.java | 18 ++++++++++++++++++ .../xml/util/CheckTagEmptyBodyInspection.java | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/java/jsp-spi/src/com/intellij/jsp/impl/JspElementDescriptor.java b/java/jsp-spi/src/com/intellij/jsp/impl/JspElementDescriptor.java index b9cbbd1e302d..5f32dbe8b8c2 100644 --- a/java/jsp-spi/src/com/intellij/jsp/impl/JspElementDescriptor.java +++ b/java/jsp-spi/src/com/intellij/jsp/impl/JspElementDescriptor.java @@ -21,4 +21,22 @@ import com.intellij.xml.XmlElementDescriptor; * @author Maxim.Mossienko */ public interface JspElementDescriptor extends XmlElementDescriptor { + + /** + * The body of the tag contains nested JSP syntax. + * @see #getContentType() + */ + int CONTENT_TYPE_JSP = CONTENT_TYPE_MIXED; + + /** + * The body accepts only template text, EL Expressions, and JSP action elements. + * No scripting elements are allowed. + */ + int CONTENT_TYPE_SCRIPTLESS = 101; + + /** + * The body of the tag is interpreted by the tag implementation itself, + * and is most likely in a different "language", e.g embedded SQL statements. + */ + int CONTENT_TYPE_TAG_DEPENDENT = 102; } diff --git a/xml/xml-analysis-impl/src/com/intellij/xml/util/CheckTagEmptyBodyInspection.java b/xml/xml-analysis-impl/src/com/intellij/xml/util/CheckTagEmptyBodyInspection.java index fdc14937782f..968ef3e34e26 100644 --- a/xml/xml-analysis-impl/src/com/intellij/xml/util/CheckTagEmptyBodyInspection.java +++ b/xml/xml-analysis-impl/src/com/intellij/xml/util/CheckTagEmptyBodyInspection.java @@ -59,7 +59,7 @@ public class CheckTagEmptyBodyInspection extends XmlSuppressableInspectionTool { if (node != null && node.getElementType() == XmlTokenType.XML_END_TAG_START) { - final LocalQuickFix localQuickFix = new ReplaceEmptyTagBodyByEmptyEndFix(); + final LocalQuickFix localQuickFix = new Fix(); holder.registerProblem( tag, XmlBundle.message("xml.inspections.tag.empty.body"), @@ -98,7 +98,7 @@ public class CheckTagEmptyBodyInspection extends XmlSuppressableInspectionTool { return "CheckTagEmptyBody"; } - private static class ReplaceEmptyTagBodyByEmptyEndFix implements LocalQuickFix { + public static class Fix implements LocalQuickFix { @Override @NotNull public String getName() {