TextRange (@NotNull PsiElement token) { if (token instanceof PsiFragment fragment) return JavaPsiStringTemplateUtil.getContentRange(fragment); PsiElement parent = token.getParent(); if (!(parent instanceof PsiLiteralExpression)) return null; final TextRange valueTextRange = StringLiteralManipulator.getValueRange((PsiLiteralExpression)token.getParent()); return valueTextRange.shiftRight(token.getTextRange().getStartOffset()); }