ThreeState (PsiElement element) { PsiElement parent = element.getParent(); if (parent instanceof YAMLDocument || parent instanceof YAMLMapping) { return ThreeState.YES; } if (parent instanceof YAMLKeyValue && isFirstChild(element, parent)) { ASTNode prev = element.getNode().getTreePrev(); return prev.getElementType() == YAMLTokenTypes.INDENT ? ThreeState.YES : ThreeState.NO; } if (parent instanceof YAMLSequenceItem && isFirstChild(element, parent)) { return ThreeState.UNSURE; } return ThreeState.NO; }