From 14b2f187399861372fa2ffe81a3c2c7aee027206 Mon Sep 17 00:00:00 2001 From: Maxim Mossienko Date: Fri, 14 Jan 2005 22:00:49 +0300 Subject: [PATCH] Fixed consequences of CVS -> Perforce upgrade --- .../daemon/impl/analysis/XmlHighlightVisitor.java | 7 ++++--- source/com/intellij/jsp/impl/TldTagDescriptor.java | 12 +++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java b/source/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java index 4848c06954e5..96124a8b368a 100644 --- a/source/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java +++ b/source/com/intellij/codeInsight/daemon/impl/analysis/XmlHighlightVisitor.java @@ -336,13 +336,14 @@ public class XmlHighlightVisitor extends PsiElementVisitor{ if (elementDescriptor == null) { return; } elementDescriptor = elementDescriptor.getElementDescriptor(tag); + + if (elementDescriptor instanceof AnyXmlElementDescriptor) { + elementDescriptor = tag.getDescriptor(); + } if (elementDescriptor == null) { addElementsForTag(tag, "Element " + name + " is not allowed here", myResult, HighlightInfoType.WRONG_REF, null); return; } - if (elementDescriptor instanceof AnyXmlElementDescriptor) { - elementDescriptor = tag.getDescriptor(); - } } else { //root tag diff --git a/source/com/intellij/jsp/impl/TldTagDescriptor.java b/source/com/intellij/jsp/impl/TldTagDescriptor.java index 823318ae4ceb..31af92e4d7ed 100644 --- a/source/com/intellij/jsp/impl/TldTagDescriptor.java +++ b/source/com/intellij/jsp/impl/TldTagDescriptor.java @@ -3,6 +3,7 @@ package com.intellij.jsp.impl; import com.intellij.xml.XmlElementDescriptor; import com.intellij.xml.XmlAttributeDescriptor; import com.intellij.xml.XmlNSDescriptor; +import com.intellij.xml.impl.schema.AnyXmlElementDescriptor; import com.intellij.xml.util.XmlUtil; import com.intellij.psi.xml.*; import com.intellij.psi.PsiElement; @@ -24,6 +25,7 @@ public class TldTagDescriptor implements XmlElementDescriptor { private String myName; private XmlAttributeDescriptor[] myAttributeDescriptors; private TldDescriptor myNsDescriptor; + private boolean myEmpty; public TldTagDescriptor() {} @@ -41,11 +43,12 @@ public class TldTagDescriptor implements XmlElementDescriptor { //todo: refactor to support full DTD spec public XmlElementDescriptor[] getElementsDescriptors(XmlTag context) { - return new XmlElementDescriptor[0]; + return EMPTY_ARRAY; } public XmlElementDescriptor getElementDescriptor(XmlTag childTag) { - return null; + if (myEmpty) return null; + return new AnyXmlElementDescriptor(this,getNSDescriptor()); } public XmlAttributeDescriptor[] getAttributesDescriptors() { @@ -89,7 +92,8 @@ public class TldTagDescriptor implements XmlElementDescriptor { } public int getContentType() { - return 0; //To change body of implemented methods use File | Settings | File Templates. + if (myEmpty) return CONTENT_TYPE_EMPTY;; + return CONTENT_TYPE_MIXED; } public PsiElement getDeclaration() { @@ -133,6 +137,8 @@ public class TldTagDescriptor implements XmlElementDescriptor { myNsDescriptor = null; } myTag = (XmlTag)element; + final XmlTag bodyContent = myTag.findFirstSubTag("bodycontent"); + if (bodyContent!=null) myEmpty = bodyContent.getValue().getText().equals("empty"); } public Object[] getDependences() {