IDEA-26947 Do not report warnings about unknown html tags
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Mon, 28 Dec 2009 14:38:23 +0000 (17:38 +0300)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Mon, 28 Dec 2009 14:38:23 +0000 (17:38 +0300)
xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlUnknownTagInspection.java
xml/impl/src/com/intellij/xml/util/CheckEmptyTagInspection.java

index d14b4f1097056e2d1b85f5eccb2a27efa1767cf2..ecbf5ed7e91aa1490b1312711ae55de0f25dff10 100644 (file)
@@ -203,10 +203,13 @@ public class HtmlUnknownTagInspection extends HtmlLocalInspectionTool {
           final PsiElement endTagName = XmlTagUtil.getEndTagNameElement(tag);
 
           final CreateNSDeclarationIntentionFix declarationIntentionFix = new CreateNSDeclarationIntentionFix(startTagName, "");
-          holder.registerProblem(startTagName, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, action, declarationIntentionFix);
+          ProblemHighlightType highlightType = tag.getContainingFile().getContext() == null ? 
+                                               ProblemHighlightType.GENERIC_ERROR_OR_WARNING : 
+                                               ProblemHighlightType.INFORMATION;
+          holder.registerProblem(startTagName, message, highlightType, action, declarationIntentionFix);
 
           if (endTagName != null) {
-            holder.registerProblem(endTagName, message, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, action, declarationIntentionFix);
+            holder.registerProblem(endTagName, message, highlightType, action, declarationIntentionFix);
           }
         }
       }
index 55096fc9f64668d1056f9fcf1fc856d382015c87..76e1624c89cd2f20ddbbbf7265df0eb77b9fd5e4 100644 (file)
@@ -102,6 +102,9 @@ public class CheckEmptyTagInspection extends XmlSuppressableInspectionTool {
 
             holder.registerProblem(tag,
                                    XmlBundle.message("html.inspections.check.empty.script.message"),
+                                   tag.getContainingFile().getContext() != null ? 
+                                     ProblemHighlightType.INFORMATION:
+                                     ProblemHighlightType.GENERIC_ERROR_OR_WARNING, 
                                    fix);
           }
         }