public static @Nullable PsiElement resolvePosition(@NotNull JsonLikePsiWalker walker,
                                                      @Nullable PsiElement element,
                                                      @NotNull JsonPointerPosition position) {
    PsiElement psiElement = element instanceof PsiFile ? ContainerUtil.getFirstItem(walker.getRoots((PsiFile)element)) : element;
    if (psiElement == null) return null;
    JsonValueAdapter value = walker.createValueAdapter(psiElement);
    while (position != null && !position.isEmpty()) {
      if (value instanceof JsonObjectValueAdapter) {
        String name = position.getFirstName();
        if (name == null) return null;
        JsonPropertyAdapter property = findProperty((JsonObjectValueAdapter)value, name);
        if (property != null) {
          value = getValue(property);
          if (value == null) return null;
        }
        else {
          JsonPropertyAdapter props = findProperty((JsonObjectValueAdapter)value, JSON_PROPERTIES);
          if (props != null) {
            value = getValue(props);
            continue;
          }

          JsonPropertyAdapter defs = findProperty((JsonObjectValueAdapter)value, JSON_DEFINITIONS);
          if (defs != null) {
            value = getValue(defs);
            continue;
          }

          JsonPropertyAdapter defs9 = findProperty((JsonObjectValueAdapter)value, DEFS);
          if (defs9 != null) {
            value = getValue(defs9);
            continue;
          }
          return null;
        }
      }
      else if (value instanceof JsonArrayValueAdapter) {
        int index = position.getFirstIndex();
        if (index >= 0) {
          List<JsonValueAdapter> values = ((JsonArrayValueAdapter)value).getElements();
          if (values.size() > index) {
            value = values.get(index);
          }
          else {
            return null;
          }
        }
      }
      position = position.skip(1);
    }
    if (value == null) {
      return null;
    }

    PsiElement delegate = value.getDelegate();
    PsiElement propertyNameElement = walker.getPropertyNameElement(delegate.getParent());
    return propertyNameElement == null ? delegate : propertyNameElement;
  }
public static @Nullable PsiElement resolvePosition(@NotNull JsonLikePsiWalker walker,
                                                      @Nullable PsiElement element,
                                                      @NotNull JsonPointerPosition position)