boolean (Object element, @Nullable PsiElement context) { if (element instanceof JsonValue) { JsonProperty property = ObjectUtils.tryCast(((JsonValue)element).getParent(), JsonProperty.class); if (property != null && property.getValue() == element && propertyName.equals(property.getName())) { final PsiFile file = property.getContainingFile(); if (rootOnly && (!(file instanceof JsonFile) || ((JsonFile)file).getTopLevelValue() != property.getParent())) return false; if (schemaOnly && !JsonSchemaService.isSchemaFile(CompletionUtil.getOriginalOrSelf(file))) return false; return true; } } return false; }