void () { final MyElement element = createElement("<a><psi-type>java.lang.String[]</psi-type></a>"); final XmlTag tag = element.getPsiType().getXmlTag(); final TextRange valueRange = tag.getValue().getTextRange(); final PsiReference reference = tag.getContainingFile().findReferenceAt(valueRange.getStartOffset() + "java.lang.".length()); assertNotNull(reference); assertEquals(PsiType.getJavaLangString(getPsiManager(), GlobalSearchScope.allScope(getProject())).resolve(), reference.resolve()); assertEquals("<psi-type>java.lang.".length(), reference.getRangeInElement().getStartOffset()); assertEquals("String".length(), reference.getRangeInElement().getLength()); }