private void adjustWhitespaceToContentType(boolean isScalar) {
    PsiElement colon = findChildByType(YAMLTokenTypes.COLON);
    assert colon != null;

    while (colon.getNextSibling() != null && !(colon.getNextSibling() instanceof YAMLValue)) {
      colon.getNextSibling().delete();
    }
    final YAMLElementGenerator generator = YAMLElementGenerator.getInstance(getProject());
    if (isScalar) {
      addAfter(generator.createSpace(), colon);
    }
    else {
      final int indent = YAMLUtil.getIndentToThisElement(this);
      addAfter(generator.createIndent(indent + 2), colon);
      addAfter(generator.createEol(), colon);
    }
  }
private void adjustWhitespaceToContentType(boolean isScalar)