@Override
  public @Nullable JsonPropertyAdapter getParentPropertyAdapter(@NotNull PsiElement element) {
    YAMLMapping mapping = PsiTreeUtil.getParentOfType(element, YAMLMapping.class, true, YAMLKeyValue.class);
    if (mapping != null && (element instanceof YAMLScalar || element.getParent() instanceof YAMLScalar)) {
      // if we reach a mapping without reaching any key-value, this is a case like:
      // - foo: bar
      //   a
      // in such cases, we should create a property adapter for "a" for proper behavior of features
      return new YamlPropertyAdapter(element.getParent());
    }
    final YAMLKeyValue property = PsiTreeUtil.getParentOfType(element, YAMLKeyValue.class, false);
    if (property == null) return null;
    // it is a parent property only if its value or its key contains the current property,
    //  or it is the property itself (we perform a non-strict parent search)
    YAMLValue value = property.getValue();
    boolean isSelf = element == property;
    PsiElement key = property.getKey();
    boolean isKey = key != null && PsiTreeUtil.isAncestor(key, element, false);
    // don't jump up from sequences
    if (!isSelf && !isKey && value instanceof YAMLSequence && value != element) return null;
    boolean isValue = value != null && PsiTreeUtil.isAncestor(value, element, false);
    if (!isKey && !isValue && !isSelf) return null;
    return new YamlPropertyAdapter(property);
  }
@Override
  public @Nullable JsonPropertyAdapter getParentPropertyAdapter(@NotNull PsiElement element)