boolean (@NotNull final PsiElement psiElement, final @NotNull List<PsiReference> references, final boolean soft) { final TextRange range = ElementManipulators.getValueTextRange(psiElement); int offset = range.getStartOffset(); int endOffset = range.getEndOffset(); final String elementText = psiElement.getText(); if (elementText == null) return false; for (DynamicContextProvider provider: DynamicContextProvider.EP_NAME.getExtensionList()) { final int dynamicOffset = provider.getOffset(psiElement, offset, elementText); if (dynamicOffset == -1) { return false; } else if (dynamicOffset != offset) { offset = dynamicOffset; } } final int pos = getLastPosOfURL(offset, elementText); if (pos != -1 && pos < endOffset) { endOffset = pos; } try { final String text = elementText.substring(offset, endOffset); return createReferences(psiElement, offset, text, references, soft); } catch (StringIndexOutOfBoundsException e) { LOG.error("Cannot process string: '" + psiElement.getParent().getParent().getText() + "'", e); return false; } }