List<TextRange> (PsiLanguageInjectionHost host) { if (!(host instanceof PsiLiteralExpression literalExpression)) { return null; } if (!literalExpression.isTextBlock()) { return null; } final TextRange textRange = ElementManipulators.getValueTextRange(host); final int indent = PsiLiteralUtil.getTextBlockIndent(literalExpression); if (indent <= 0) { return Collections.singletonList(textRange); } final String text = literalExpression.getText(); int startOffset = textRange.getStartOffset() + indent; int endOffset = text.indexOf('\n', startOffset); final List<TextRange> result = new SmartList<>(); while (endOffset > 0) { endOffset++; result.add(new TextRange(startOffset, endOffset)); startOffset = endOffset + indent; endOffset = text.indexOf('\n', startOffset); } endOffset = textRange.getEndOffset(); if (startOffset <= endOffset) { result.add(new TextRange(startOffset, endOffset)); } return result; }