do not complain about uri refs in namespace declarations inside injected content
authorMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 2 Dec 2009 15:13:45 +0000 (18:13 +0300)
committerMaxim.Mossienko <Maxim.Mossienko@jetbrains.com>
Wed, 2 Dec 2009 15:13:45 +0000 (18:13 +0300)
xml/impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/URIReferenceProvider.java

index 2e6442f03b1845c4664b9d9ee6d27db3406f78d2..6dbcab0dbda9afb5ba15e8b8a98119cdc289f4c2 100644 (file)
@@ -139,10 +139,12 @@ public class URIReferenceProvider extends PsiReferenceProvider {
          )
       ) {
       if (!s.startsWith(XmlUtil.TAG_DIR_NS_PREFIX)) {
-        final boolean namespaceSoftRef = parent instanceof XmlAttribute &&
+        boolean namespaceSoftRef = parent instanceof XmlAttribute &&
           NAMESPACE_ATTR_NAME.equals(((XmlAttribute)parent).getName()) &&
           ((XmlAttribute)parent).getParent().getAttributeValue("schemaLocation") != null;
-
+        if (!namespaceSoftRef && parent instanceof XmlAttribute && ((XmlAttribute)parent).isNamespaceDeclaration()) {
+          namespaceSoftRef = parent.getContainingFile().getContext() != null;
+        }
         return getUrlReference(element, namespaceSoftRef);
       }
     }