diff --git a/xml/impl/src/com/intellij/html/impl/MicrodataAttributeDescriptorsProvider.java b/xml/impl/src/com/intellij/html/impl/MicrodataAttributeDescriptorsProvider.java index 2279ca785aee..319ae1a9d5b4 100644 --- a/xml/impl/src/com/intellij/html/impl/MicrodataAttributeDescriptorsProvider.java +++ b/xml/impl/src/com/intellij/html/impl/MicrodataAttributeDescriptorsProvider.java @@ -94,9 +94,10 @@ public class MicrodataAttributeDescriptorsProvider implements XmlAttributeDescri private static class MicrodataPropertyAttributeDescriptor extends AnyXmlAttributeDescriptor { + @NotNull private final XmlTag myContext; - public MicrodataPropertyAttributeDescriptor(XmlTag context) { + public MicrodataPropertyAttributeDescriptor(@NotNull XmlTag context) { super(ITEM_PROP); myContext = context; } @@ -114,7 +115,7 @@ public class MicrodataAttributeDescriptorsProvider implements XmlAttributeDescri @Override public String[] getEnumeratedValues() { - final XmlTag scopeParent = findScopeTag(myContext); + final XmlTag scopeParent = findScopeTag(myContext.getParentTag()); return scopeParent != null ? findProperties(scopeParent) : super.getEnumeratedValues(); } diff --git a/xml/tests/src/com/intellij/html/MicrodataCompletionTest.java b/xml/tests/src/com/intellij/html/MicrodataCompletionTest.java index 988fe496f109..5b40884bc054 100644 --- a/xml/tests/src/com/intellij/html/MicrodataCompletionTest.java +++ b/xml/tests/src/com/intellij/html/MicrodataCompletionTest.java @@ -151,4 +151,25 @@ public class MicrodataCompletionTest extends CodeInsightFixtureTestCase { "name", "nickname", "photo", "title", "role", "url", "affiliation", "friend", "acquaintance", "address" ); } + + public void testPropValueNestedScopes() throws Throwable { + final VirtualFile personFile = myFixture.copyFileToProject("Person.html"); + final VirtualFile addressFile = myFixture.copyFileToProject("Address.html"); + ApplicationManager.getApplication().runWriteAction(new Runnable() { + @Override + public void run() { + ExternalResourceManager.getInstance().addResource("http://data-vocabulary.org/Person", personFile.getPath()); + ExternalResourceManager.getInstance().addResource("http://data-vocabulary.org/Address", addressFile.getPath()); + } + }); + doTestInHtml("