boolean (final @NotNull PsiElement psiElement, final @NotNull List<PsiReference> references, final boolean soft) { final TextRange range = ElementManipulators.getValueTextRange(psiElement); final String elementText = psiElement.getText(); final int anchorOffset = elementText.indexOf('#'); if (anchorOffset == -1) { return false; } final boolean dynamic = isDynamic(psiElement, anchorOffset + 1, elementText); if (dynamic) { return false; } FileReference fileReference = null; if (range.getStartOffset() != anchorOffset) { fileReference = findFileReference(references); if (fileReference == null || fileReference.resolve() == null) { return false; } } final int pos = elementText.indexOf('?', anchorOffset); final String anchor; try { int endIndex = pos != -1 ? pos : range.getEndOffset(); if (endIndex <= anchorOffset) { endIndex = anchorOffset + 1; } anchor = elementText.substring(anchorOffset + 1, endIndex); } catch (StringIndexOutOfBoundsException e) { throw new RuntimeException(elementText, e); } final AnchorReferenceImpl anchorReference = new AnchorReferenceImpl(anchor, fileReference, psiElement, anchorOffset + 1, soft); references.add(anchorReference); return false; }