boolean (@NotNull PsiElement element) { PsiElement sibling = element.getParent(); // element is leaf, parent is reference expression while ((sibling = sibling.getPrevSibling()) != null) { if (":".equals(sibling.getText())) return false; // no completion for values } return true; }