EA-26644 when no tag name is present, associate dom errors with the whole tag

This commit is contained in:
peter
2011-04-07 19:50:11 +02:00
parent 33e877a873
commit 3c42ecba17
@@ -174,7 +174,10 @@ public class DomElementProblemDescriptorImpl implements DomElementProblemDescrip
private static Pair<TextRange, PsiElement> createTagNameRange(final XmlTag tag) {
final PsiElement startToken = XmlTagUtil.getStartTagNameElement(tag);
assert startToken != null : tag.getText();
if (startToken == null) {
return Pair.create(tag.getTextRange(), (PsiElement)tag);
}
return Pair.create(startToken.getTextRange().shiftRight(-tag.getTextRange().getStartOffset()), (PsiElement)tag);
}