@Override
  public @Nullable Spacing getSpacing(final Block child1, final @NotNull Block child2) {
    int shift = 0;
    Block child1ToUse = child1;
    Block child2ToUse = child2;
    if (child1 instanceof InjectedLanguageBlockWrapper) {
      child1ToUse = ((InjectedLanguageBlockWrapper)child1).myOriginal;
      shift = child1.getTextRange().getStartOffset() - child1ToUse.getTextRange().getStartOffset();
    }
    if (child2 instanceof InjectedLanguageBlockWrapper) child2ToUse = ((InjectedLanguageBlockWrapper)child2).myOriginal;
    Spacing spacing = myOriginal.getSpacing(child1ToUse, child2ToUse);
    if (spacing instanceof DependantSpacingImpl hostSpacing && shift != 0) {
      final int finalShift = shift;
      List<TextRange> shiftedRanges = ContainerUtil.map(hostSpacing.getDependentRegionRanges(), range -> range.shiftRight(finalShift));
      return new DependantSpacingImpl(
        hostSpacing.getMinSpaces(), hostSpacing.getMaxSpaces(), shiftedRanges,
        hostSpacing.shouldKeepLineFeeds(), hostSpacing.getKeepBlankLines(), DependentSpacingRule.DEFAULT
      );
    }
    return spacing;
  }
@Override
  public @Nullable Spacing getSpacing(final Block child1, final @NotNull Block child2)