private static boolean isEnclosingDefinition(PsiClass owner, PsiElement startElement) {
    if (owner instanceof GrTypeDefinition definition) {
      return startElement.getParent() == definition.getBody();
    }
    return false;
  }
private static boolean isEnclosingDefinition(PsiClass owner, PsiElement startElement)