do not process xs:include for stub building

This commit is contained in:
Dmitry Avdeev
2014-04-25 15:34:02 +04:00
parent 9bc7805376
commit eed0df212a
4 changed files with 20 additions and 1 deletions
+3
View File
@@ -0,0 +1,3 @@
<foo>
<bar string="included" int="666"></bar>
</foo>
@@ -0,0 +1,5 @@
<foo xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="include.xml" xpointer="xpointer(/foo/*)"/>
<bar string="xxx" int="666"></bar>
<bar></bar>
</foo>
@@ -81,6 +81,16 @@ public class DomStubBuilderTest extends DomStubTest {
assertNull(stubTree); // no stubs for invalid XML
}
public void testInclusion() throws Exception {
myFixture.copyFileToProject("include.xml");
doBuilderTest("inclusion.xml", "File:foo\n" +
" Element:foo\n" +
" Element:bar\n" +
" Attribute:string:xxx\n" +
" Attribute:int:666\n" +
" Element:bar\n");
}
public static class TestExtender extends DomExtender<Bar> {
@Override
@@ -42,7 +42,8 @@ class InclusionProvider implements CachedValueProvider<PsiElement[]> {
@NotNull
public static PsiElement[] getIncludedTags(XmlTag xincludeTag) {
return CachedValuesManager.getManager(xincludeTag.getProject()).getCachedValue(xincludeTag, new InclusionProvider(xincludeTag));
if (XmlUtil.isStubBuilding()) return PsiElement.EMPTY_ARRAY;
return CachedValuesManager.getCachedValue(xincludeTag, new InclusionProvider(xincludeTag));
}
public Result<PsiElement[]> compute() {