int (@NotNull PsiElement e) { PsiElement parent = e.getParent(); if (!(parent instanceof JsonArray)) return -1; List<JsonValue> elements = ((JsonArray)parent).getValueList(); for (int i = 0; i < elements.size(); i++) { if (e == elements.get(i)) { return i; } } return -1; }