void (@NotNull PsiElement expression, @NotNull Editor editor) { if (expression instanceof PsiReferenceExpression ref) { JavaResolveResult result = ref.advancedResolve(true); PsiElement element = result.getElement(); if (element instanceof PsiClass psiClass) { WriteAction.run(() -> insertConstructorCallWithSmartBraces(expression, editor, psiClass)); return; } } super.expandForChooseExpression(expression, editor); }