PsiElement (@NotNull PsiElement element) { PsiElement current = element; while (current != null && !(current instanceof PsiFile)) { if (current instanceof JsonValue || current instanceof JsonProperty) { return current; } current = current.getParent(); } return null; }