boolean (@NotNull PsiElement element) { PsiElement parentStatement = PsiTreeUtil.findFirstParent(element, e -> e instanceof KtExpression && KtPsiUtil.isStatementContainer(e.getParent())); if (parentStatement == null) return false; // We are in the leftmost position in parentStatement return element.getTextOffset() == parentStatement.getTextOffset(); }