mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not process xs:include for stub building
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user