RangeMarker (RangeMarker leader, PsiFile file, Document document) { final TextRange leaderRange = leader.getTextRange(); final int offset = leader.getStartOffset(); PsiElement element = findNameElement(InjectedLanguageUtilBase.findElementAtNoCommit(file, offset)); TextRange support = findSupportRange(element); if (!isSupportRangeValid(document, leaderRange, support) && file.getViewProvider() instanceof MultiplePsiFilesPerDocumentFileViewProvider) { element = findNameElement(file.getViewProvider().findElementAt(offset, myLanguage)); support = findSupportRange(element); } if (!isSupportRangeValid(document, leaderRange, support)) return findSupportForEmptyTag(leader, element, document); return document.createRangeMarker(support.getStartOffset(), support.getEndOffset(), true); }