private static List<TextRange> getTextBlockInjectedArea(PsiLanguageInjectionHost host) {
      final int indent;
      if (host instanceof PsiLiteralExpression literalExpression && literalExpression.isTextBlock()) {
        indent = PsiLiteralUtil.getTextBlockIndent(literalExpression);
      }
      else if (host instanceof PsiFragment fragment && fragment.isTextBlock()) {
        indent = PsiFragmentImpl.getTextBlockFragmentIndent(fragment);
      }
      else {
        return null;
      }
      final TextRange textRange = ElementManipulators.getValueTextRange(host);
      if (indent <= 0) {
        return Collections.singletonList(textRange);
      }

      final String text = host.getText();
      boolean noIndent = host instanceof PsiFragment fragment && fragment.getTokenType() != JavaTokenType.TEXT_BLOCK_TEMPLATE_BEGIN;
      int startOffset = textRange.getStartOffset() + (noIndent ? 0 : indent);
      int endOffset = text.indexOf('\n', startOffset);
      final List<TextRange> result = new SmartList<>();
      while (endOffset > 0) {
        int lastCharPos = StringUtil.skipWhitespaceBackward(text, endOffset);
        endOffset++;
        if (lastCharPos > 0 && text.charAt(lastCharPos - 1) == '\\') {
          result.add(new TextRange(startOffset, lastCharPos));
        } else {
          result.add(new TextRange(startOffset, endOffset));
        }
        int newEndOffset = text.indexOf('\n', endOffset);
        startOffset = Math.min(endOffset + indent, newEndOffset == -1 ? Integer.MAX_VALUE : newEndOffset);
        endOffset = newEndOffset;
      }
      endOffset = textRange.getEndOffset();
      if (startOffset <= endOffset) {
        result.add(new TextRange(startOffset, endOffset));
      }
      return result;
    }
private static List<TextRange> getTextBlockInjectedArea(PsiLanguageInjectionHost host)