mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-199839 Support deprecation in xsd schemas
fixed schema prefix issue
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="test.deprecated" elementFormDefault="qualified">
|
||||
<element name="root">
|
||||
<complexType>
|
||||
<sequence>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="test.deprecated" elementFormDefault="qualified">
|
||||
<xs:element name="root">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<!-- deprecated element -->
|
||||
<element name="deprecated"/>
|
||||
<element name="deprecatedByDoc">
|
||||
<annotation>
|
||||
<documentation>Some doc</documentation>
|
||||
<documentation>deprecated</documentation>
|
||||
</annotation>
|
||||
</element>
|
||||
<element name="deprecatedByCdata">
|
||||
<annotation>
|
||||
<documentation>
|
||||
<xs:element name="deprecated"/>
|
||||
<xs:element name="deprecatedByDoc">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Some doc</xs:documentation>
|
||||
<xs:documentation>deprecated</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="deprecatedByCdata">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
<![CDATA[deprecated]]>
|
||||
</documentation>
|
||||
</annotation>
|
||||
</element>
|
||||
</sequence>
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
<!-- DEPRECATED attribute -->
|
||||
<attribute name="deprecated"/>
|
||||
</complexType>
|
||||
</element>
|
||||
</schema>
|
||||
<xs:attribute name="deprecated"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
+3
-1
@@ -10,6 +10,7 @@ import com.intellij.psi.PsiElementVisitor;
|
||||
import com.intellij.psi.XmlElementVisitor;
|
||||
import com.intellij.psi.meta.PsiMetaData;
|
||||
import com.intellij.psi.xml.*;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.xml.util.XmlUtil;
|
||||
import org.intellij.lang.annotations.Language;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -59,7 +60,8 @@ public class XmlDeprecatedElementInspection extends XmlSuppressableInspectionToo
|
||||
if (!(declaration instanceof XmlTag)) return false;
|
||||
XmlComment comment = XmlUtil.findPreviousComment(declaration);
|
||||
if (comment != null && pattern.matcher(comment.getCommentText().trim()).matches()) return true;
|
||||
return checkTag(((XmlTag)declaration).findFirstSubTag("annotation"), pattern);
|
||||
XmlTag tag = (XmlTag)declaration;
|
||||
return checkTag(ArrayUtil.getFirstElement(tag.findSubTags("annotation", tag.getNamespace())), pattern);
|
||||
}
|
||||
|
||||
private static boolean checkTag(XmlTag tag, Pattern pattern) {
|
||||
|
||||
Reference in New Issue
Block a user