StringPartInfo (@NotNull PsiFile file, int startOffset, int endOffset) { final PsiElement start = file.findElementAt(startOffset); final PsiElement fin = file.findElementAt(endOffset - 1); if (start == null || fin == null) return null; final PsiElement psi = PsiTreeUtil.findCommonParent(start, fin); if (psi == null) return null; GrLiteral literal = findLiteral(psi); if (literal != null && checkSelectedRange(startOffset, endOffset, literal)) { return new StringPartInfo(literal, new TextRange(startOffset, endOffset)); } return null; }