String (@Nullable PsiElement psiElement) { if (psiElement instanceof YAMLDocument) { return "---"; } else if (psiElement instanceof PsiComment) { return "# ..."; } else if (psiElement instanceof YAMLScalar) { return normalizePlaceHolderText(((YAMLScalar)psiElement).getTextValue()); } else if (psiElement instanceof YAMLSequence) { final int size = ((YAMLSequence)psiElement).getItems().size(); final String placeholder = size + " " + StringUtil.pluralize("item", size); if (psiElement instanceof YAMLArrayImpl) { return "[" + placeholder + "]"; } else if (psiElement instanceof YAMLBlockSequenceImpl) { return "<" + placeholder + ">"; } } else if (psiElement instanceof YAMLMapping) { final int size = ((YAMLMapping)psiElement).getKeyValues().size(); final String placeholder = size + " " + StringUtil.pluralize("key", size); if (psiElement instanceof YAMLHashImpl) { return "{" + placeholder + "}"; } else if (psiElement instanceof YAMLBlockMappingImpl) { return "<" + placeholder + ">"; } } else if (psiElement instanceof YAMLKeyValue) { return normalizePlaceHolderText(((YAMLKeyValue)psiElement).getKeyText()) + ": " + getPlaceholderText(((YAMLKeyValue)psiElement).getValue()); } else if (psiElement instanceof YAMLSequenceItem) { return "- " + getPlaceholderText(((YAMLSequenceItem)psiElement).getValue()); } return "..."; }