void (@NotNull XmlAttributeValue element, final Collection<? super PsiReference> refs) { final DomElement domElement = DomUtil.getDomElement(element); if (domElement == null) { return; } final AntDomMacroDef macrodef = domElement.getParentOfType(AntDomMacroDef.class, true); if (macrodef == null) { return; } final String text = ElementManipulators.getValueText(element); final int valueBeginingOffset = Math.abs(element.getTextRange().getStartOffset() - element.getValueTextRange().getStartOffset()); int startIndex; int endIndex = -1; while ((startIndex = text.indexOf("@{", endIndex + 1)) > endIndex) { startIndex += 2; endIndex = startIndex; int nestedBrackets = 0; while (text.length() > endIndex) { final char ch = text.charAt(endIndex); if (ch == '}') { if (nestedBrackets == 0) { break; } --nestedBrackets; } else if (ch == '{') { ++nestedBrackets; } ++endIndex; } if(nestedBrackets > 0 || endIndex == text.length()) return; if (endIndex >= startIndex) { //final String name = text.substring(startIndex, endIndex); refs.add(new AntDomMacrodefAttributeReference(element, new TextRange(valueBeginingOffset + startIndex, valueBeginingOffset + endIndex))); } endIndex = startIndex; } } }