void (@NotNull PsiElement element, @NotNull List<PsiElement> result) { // include all parents as well PsiElement parent = element.getParent(); while (parent != null && !(parent instanceof JsonFile)) { result.add(parent); parent = parent.getParent(); } }