TextRange (PsiElement element) { if (element instanceof PyStringLiteralExpression) { final List<TextRange> ranges = ((PyStringLiteralExpression)element).getStringValueTextRanges(); return ranges.get(0); } else { return new TextRange(0, element.getTextLength()); } }