boolean (@NotNull PsiFile file, int offset) { return file instanceof JsonFile && psiElement().inside(psiElement(JsonValue.class) .with(new PatternCondition<PsiElement>("insidePropertyKey") { @Override public boolean accepts(@NotNull PsiElement element, ProcessingContext context) { return JsonPsiUtil.isPropertyKey(element); } })).beforeLeaf(psiElement(JsonElementTypes.COLON)).accepts(file.findElementAt(offset)); }