void (@NotNull ProgressIndicator progress) { if (ApplicationManager.getApplication().isUnitTestMode()) { return; } if (!WebEditorOptions.getInstance().isTagTreeHighlightingEnabled()) { return; } int offset = myEditor.getCaretModel().getOffset(); PsiElement[] elements = PsiFileBreadcrumbsCollector.getLinePsiElements(myEditor.getDocument(), offset, myFile.getVirtualFile(), myProject, myInfoProvider); if (elements == null || elements.length == 0 || !XmlTagTreeHighlightingUtil.containsTagsWithSameName(elements)) { elements = PsiElement.EMPTY_ARRAY; FileViewProvider provider = myFile.getViewProvider(); for (Language language : provider.getLanguages()) { PsiElement element = provider.findElementAt(offset, language); if (!isTagStartOrEnd(element)) { element = null; } if (element == null && offset > 0) { element = provider.findElementAt(offset - 1, language); if (!isTagStartOrEnd(element)) element = null; } XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class); if (tag != null) { elements = new PsiElement[] {tag}; } } } for (int i = elements.length - 1; i >= 0; i--) { if (elements[i] instanceof XmlTag) { myPairsToHighlight.add(getTagRanges((XmlTag)elements[i])); } } }